]> git.eshelyaron.com Git - emacs.git/commitdiff
* unexelf.c: Use a different way to cause a compilation error if anyone uses
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Mar 2011 02:07:47 +0000 (19:07 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Mar 2011 02:07:47 +0000 (19:07 -0700)
n rather than nn, a way that does not involve shadowing.

src/ChangeLog
src/unexelf.c

index dc3074697e3a377b974444328d8f6a39864d46df..8832388994cbef3f5f1a676bd7159d333dbf5f50 100644 (file)
@@ -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.
 
index 01d41a15d5000a38ee433bc3b910854e912afe60..3e664307d5953aee0d4e2d1bafbe8f27da9da03a 100644 (file)
@@ -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.  */