aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-03-16 19:07:47 -0700
committerPaul Eggert2011-03-16 19:07:47 -0700
commit9ae7151257f2457c0a6d89fb2b97f59fb18f1b96 (patch)
tree1f448c6caedb7b54d84d97e2b825f2977d7ad49b /src
parentb3967b18cddd39cd736af29db48096716f35fbdf (diff)
downloademacs-9ae7151257f2457c0a6d89fb2b97f59fb18f1b96.tar.gz
emacs-9ae7151257f2457c0a6d89fb2b97f59fb18f1b96.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog2
-rw-r--r--src/unexelf.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index dc3074697e3..8832388994c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -2,6 +2,8 @@
2 2
3 * unexelf.c (unexec): Name an expression, 3 * unexelf.c (unexec): Name an expression,
4 to avoid gcc -Wbad-function-cast warning. 4 to avoid gcc -Wbad-function-cast warning.
5 Use a different way to cause a compilation error if anyone uses
6 n rather than nn, a way that does not involve shadowing.
5 7
6 * deps.mk (unexalpha.o): Remove; unused. 8 * deps.mk (unexalpha.o): Remove; unused.
7 9
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:
1235 ElfW(Shdr) section = NEW_SECTION_H (n); 1235 ElfW(Shdr) section = NEW_SECTION_H (n);
1236 1236
1237 /* Cause a compilation error if anyone uses n instead of nn below. */ 1237 /* Cause a compilation error if anyone uses n instead of nn below. */
1238 struct {int a;} n; 1238 #define n ((void) 0);
1239 (void)n.a; /* Prevent `unused variable' warnings. */ 1239 n /* Prevent 'macro "n" is not used' warnings. */
1240 1240
1241 switch (section.sh_type) 1241 switch (section.sh_type)
1242 { 1242 {
@@ -1283,6 +1283,8 @@ temacs:
1283 } 1283 }
1284 break; 1284 break;
1285 } 1285 }
1286
1287 #undef n
1286 } 1288 }
1287 1289
1288 /* Write out new_file, and free the buffers. */ 1290 /* Write out new_file, and free the buffers. */