mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
lib: enable deprecation warnings by default
Right now, deprecated functions of the library do not trigger any compiler deprecation warning by default; they do that only if GUESTFS_WARN_DEPRECATED=1 is defined. However, this is not something that seems to be done often -- at least none of the projects using the libguestfs C API does that. Hence, do a small behaviour change to change this on the other way round: now deprecated functions trigger compiler deprecation warnings by default, using GUESTFS_NO_WARN_DEPRECATED to disable this (and revert to the previous behaviour). Even though deprecated functions will not be removed, we really want users to migrate away from them, as they were deprecated for good reasons. Define GUESTFS_NO_WARN_DEPRECATED where needed: - in all the bindings, as they bind all the functions including the deprecated ones - in the guestfish actions, as it exposes almost all the APIs - in the C API test, as it runs the automated tests of all the APIs that have them - for two tests that explicitly test deprecated functions
This commit is contained in:
@@ -412,6 +412,9 @@ and generate_ocaml_c () =
|
||||
pr "\
|
||||
#include <config.h>
|
||||
|
||||
/* It is safe to call deprecated functions from this file. */
|
||||
#define GUESTFS_NO_WARN_DEPRECATED
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
Reference in New Issue
Block a user