This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: f/ansify.c uses ANSI features
- To: dave at hiauly1 dot hia dot nrc dot ca (John David Anglin)
- Subject: Re: f/ansify.c uses ANSI features
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Thu, 5 Apr 2001 16:41:06 -0400 (EDT)
- Cc: gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
> 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 <dave@hiauly1.hia.nrc.ca>
* 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;