From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John David Anglin" To: dave@hiauly1.hia.nrc.ca (John David Anglin) Cc: gcc-bugs@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: f/ansify.c uses ANSI features Date: Thu, 05 Apr 2001 13:41:00 -0000 Message-id: <200104052041.QAA09639@hiauly1.hia.nrc.ca> References: X-SW-Source: 2001-04/msg00336.html > I have enclosed an untested patch for discussion/review. This is better. It squelches a couple of warnings when compiled with `-Wstrict-prototypes -Wmissing-prototypes'. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605) 2001-04-05 John David Anglin * ansify.c (die_unless): Provide definition suitable for cpp that doesn't have ANSI # stringizing operator. (die, main): Prototype and don't use ANSI declaration style. --- ansify.c.orig Tue Aug 29 17:39:48 2000 +++ ansify.c Thu Apr 5 16:30:43 2001 @@ -22,6 +22,7 @@ #include "hconfig.h" #include "system.h" +#ifdef HAVE_STRINGIZE #define die_unless(c) \ do if (!(c)) \ { \ @@ -29,15 +30,30 @@ die (); \ } \ while(0) +#else +#define die_unless(c) \ + do if (!(c)) \ + { \ + fprintf (stderr, "%s:%lu: %s\n", argv[1], lineno, "c"); \ + die (); \ + } \ + while(0) +#endif + +static void ATTRIBUTE_NORETURN die PARAMS ((void)); static void ATTRIBUTE_NORETURN -die (void) +die () { exit (1); } +extern int main PARAMS ((int, const char *const *)); + int -main(int argc, char **argv) +main (argc, argv) + int argc; + const char *const *argv; { int c; static unsigned long lineno = 1;