Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/shutdown __CONCAT does token pasting, not string concat...



details:   https://anonhg.NetBSD.org/src/rev/3f69963f9421
branches:  trunk
changeset: 500884:3f69963f9421
user:      cgd <cgd%NetBSD.org@localhost>
date:      Wed Dec 20 00:31:41 2000 +0000

description:
__CONCAT does token pasting, not string concatnation.  if something like:
        __CONCAT("foo","bar");
actually works to concantate strings, it's because the preprocessor expands
it into "foo""bar" as separate strings, and then ANSI string concatenation
is performed on that.  It's more straightforward to just use ANSI string
concatenation directly, and newer GCCs complain (rightly) about misuse
of token pasting.

diffstat:

 sbin/shutdown/shutdown.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r bb62b10166d4 -r 3f69963f9421 sbin/shutdown/shutdown.c
--- a/sbin/shutdown/shutdown.c  Wed Dec 20 00:24:23 2000 +0000
+++ b/sbin/shutdown/shutdown.c  Wed Dec 20 00:31:41 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: shutdown.c,v 1.37 2000/07/25 18:59:44 jdolecek Exp $   */
+/*     $NetBSD: shutdown.c,v 1.38 2000/12/20 00:31:41 cgd Exp $        */
 
 /*
  * Copyright (c) 1988, 1990, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)shutdown.c 8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: shutdown.c,v 1.37 2000/07/25 18:59:44 jdolecek Exp $");
+__RCSID("$NetBSD: shutdown.c,v 1.38 2000/12/20 00:31:41 cgd Exp $");
 #endif
 #endif /* not lint */
 
@@ -483,7 +483,7 @@
 dorcshutdown()
 {
        (void)printf("\r\nAbout to run shutdown hooks...\r\n");
-       (void)system(__CONCAT(". ", _PATH_RCSHUTDOWN));
+       (void)system(". " _PATH_RCSHUTDOWN);
        (void)sleep(5);         /* Give operator a chance to abort this. */
        (void)printf("\r\nDone running shutdown hooks.\r\n");
 }



Home | Main Index | Thread Index | Old Index