From: Paul Eggert Date: Thu, 17 Mar 2011 02:07:47 +0000 (-0700) Subject: * unexelf.c: Use a different way to cause a compilation error if anyone uses X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~554^2~7 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9ae7151257f2457c0a6d89fb2b97f59fb18f1b96;p=emacs.git * unexelf.c: Use a different way to cause a compilation error if anyone uses n rather than nn, a way that does not involve shadowing. --- diff --git a/src/ChangeLog b/src/ChangeLog index dc3074697e3..8832388994c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,6 +2,8 @@ * unexelf.c (unexec): Name an expression, to avoid gcc -Wbad-function-cast warning. + Use a different way to cause a compilation error if anyone uses + n rather than nn, a way that does not involve shadowing. * deps.mk (unexalpha.o): Remove; unused. diff --git a/src/unexelf.c b/src/unexelf.c index 01d41a15d50..3e664307d59 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -1235,8 +1235,8 @@ temacs: ElfW(Shdr) section = NEW_SECTION_H (n); /* Cause a compilation error if anyone uses n instead of nn below. */ - struct {int a;} n; - (void)n.a; /* Prevent `unused variable' warnings. */ + #define n ((void) 0); + n /* Prevent 'macro "n" is not used' warnings. */ switch (section.sh_type) { @@ -1283,6 +1283,8 @@ temacs: } break; } + + #undef n } /* Write out new_file, and free the buffers. */