Michael Tautschnig <m...@debian.org> writes: >> I generally agree with you that it would be better to write >> -Wundef-clean code, but a lot of examples from, say, Autoconf are not >> -Wundef-clean, so I suspect there's a lot of this out there. And since >> behavior of an undefined variable in preprocessor directives is >> well-defined by the standard, you'll probably get pushback against >> making it a rule.
> Yes, indeed, this case is explicitly covered. So maybe the rule should > rather be "use -Wundef with your own header files only." > I've adjusted the severity to wishlist, but feel free to tag it wontfix. I just ran into a similar problem with other warnings (listed below). I think the reason why this is just now surfacing is that krb5-config was changed to use the MIT-specific paths in -I flags, which means they're no longer marked by gcc as system header files. gcc therefore warns about issues in them based on the compilation flags of the program. In other words, if the source base is -Wundef-clean, you should be able to build it with -Wundef, but the change in include paths is defeating that. Changing -I /usr/include/mit-krb5 to -isystem /usr/include/mit-krb5 when building the software will probably fix this. However, -isystem is gcc-specific, so I'm not sure it's a good idea for krb5-config to spit out that flag instead of -I, even on Debian. One approach may be to modify the include files provided by MIT Kerberos to tag themselves as system headers directly. From the GCC documentation: There is also a directive, #pragma GCC system_header, which tells GCC to consider the rest of the current include file a system header, no matter where it was found. Code that comes before the ‘#pragma’ in the file will not be affected. #pragma GCC system_header has no effect in the primary source file. Another, obviously, would be to clean up these various issues in the header files. Here are the warnings that I'm now seeing when building with fairly aggressive warning options (although not -Wundef): In file included from /usr/include/mit-krb5/gssrpc/rpc.h:46:0, from /usr/include/mit-krb5/kadm5/admin.h:45, from ./portable/kadmin.h:27, from tests/tap/kadmin.c:36: /usr/include/mit-krb5/gssrpc/xdr.h:105:1: error: function declaration isn’t a prototype [-Werror=strict-prototypes] typedef bool_t (*xdrproc_t)(); ^ In file included from /usr/include/mit-krb5/gssrpc/rpc.h:49:0, from /usr/include/mit-krb5/kadm5/admin.h:45, from ./portable/kadmin.h:27, from tests/tap/kadmin.c:36: /usr/include/mit-krb5/gssrpc/auth.h:199:1: error: function declaration isn’t a prototype [-Werror=strict-prototypes] extern AUTH *authdes_create(); ^ In file included from /usr/include/mit-krb5/gssrpc/types.h:177:0, from /usr/include/mit-krb5/gssrpc/rpc.h:42, from /usr/include/mit-krb5/kadm5/admin.h:45, from ./portable/kadmin.h:27, from tests/tap/kadmin.c:36: /usr/include/mit-krb5/gssrpc/rename.h:216:20: error: redundant redeclaration of ‘gssrpc_svc_maxfd’ [-Werror=redundant-decls] #define svc_maxfd gssrpc_svc_maxfd ^ /usr/include/mit-krb5/gssrpc/svc.h:290:12: note: in expansion of macro ‘svc_maxfd’ extern int svc_maxfd; ^ /usr/include/mit-krb5/gssrpc/rename.h:216:20: note: previous declaration of ‘gssrpc_svc_maxfd’ was here #define svc_maxfd gssrpc_svc_maxfd ^ /usr/include/mit-krb5/gssrpc/svc.h:282:12: note: in expansion of macro ‘svc_maxfd’ extern int svc_maxfd; ^ In file included from /usr/include/mit-krb5/gssrpc/rpc.h:68:0, from /usr/include/mit-krb5/kadm5/admin.h:45, from ./portable/kadmin.h:27, from tests/tap/kadmin.c:36: /usr/include/mit-krb5/gssrpc/svc.h:296:1: error: function declaration isn’t a prototype [-Werror=strict-prototypes] extern void rpctest_service(); ^ In file included from ./portable/kadmin.h:31:0, from tests/tap/kadmin.c:36: /usr/include/mit-krb5/kadm5/kadm_err.h:67:33: error: redundant redeclaration of ‘et_ovk_error_table’ [-Werror=redundant-decls] extern const struct error_table et_ovk_error_table; ^ In file included from /usr/include/mit-krb5/kadm5/admin.h:49:0, from ./portable/kadmin.h:27, from tests/tap/kadmin.c:36: /usr/include/mit-krb5/kadm5/kadm_err.h:67:33: note: previous declaration of ‘et_ovk_error_table’ was here extern const struct error_table et_ovk_error_table; ^ In file included from ./portable/kadmin.h:31:0, from tests/tap/kadmin.c:36: /usr/include/mit-krb5/kadm5/kadm_err.h:68:13: error: redundant redeclaration of ‘initialize_ovk_error_table’ [-Werror=redundant-decls] extern void initialize_ovk_error_table(void); ^ In file included from /usr/include/mit-krb5/kadm5/admin.h:49:0, from ./portable/kadmin.h:27, from tests/tap/kadmin.c:36: /usr/include/mit-krb5/kadm5/kadm_err.h:68:13: note: previous declaration of ‘initialize_ovk_error_table’ was here extern void initialize_ovk_error_table(void); ^ In file included from ./portable/kadmin.h:31:0, from tests/tap/kadmin.c:36: /usr/include/mit-krb5/kadm5/kadm_err.h:71:13: error: redundant redeclaration of ‘initialize_ovk_error_table_r’ [-Werror=redundant-decls] extern void initialize_ovk_error_table_r(struct et_list **list); ^ In file included from /usr/include/mit-krb5/kadm5/admin.h:49:0, from ./portable/kadmin.h:27, from tests/tap/kadmin.c:36: /usr/include/mit-krb5/kadm5/kadm_err.h:71:13: note: previous declaration of ‘initialize_ovk_error_table_r’ was here extern void initialize_ovk_error_table_r(struct et_list **list); ^ -- Russ Allbery (r...@debian.org) <http://www.eyrie.org/~eagle/> -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org