bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] Problem with test mode of getdate.y


From: Derek Robert Price
Subject: [Bug-gnulib] Problem with test mode of getdate.y
Date: Wed, 28 Apr 2004 18:03:10 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If I define TEST when compiling getdate.c, I get the following error:

In file included from getdate.y:1251:
/usr/include/stdio.h:387:25: macro "getchar" passed 1 arguments, but
takes just
0
In file included from /usr/include/stdio.h:676,
                 from getdate_test.y:1251:
/usr/include/bits/stdio.h:41:14: macro "getchar" passed 1 arguments,
but takes just 0
In file included from /usr/include/stdio.h:676,
                 from getdate_test.y:1251:
/usr/include/bits/stdio.h:42: syntax error before '{' token
/usr/include/bits/stdio.h:93: redefinition of `putchar_unlocked'
/usr/include/bits/stdio.h:67: `putchar_unlocked' previously defined here
make[2]: *** [getdate-getdate.o] Error 1


I'm guessing that the redefinition of getchar() in unlocked-io.h is
somehow interfering with the definition of getchar() in stdio.h.  I
can confirm that unlocked-io.h is the only #include that needs to
occur before the #include of stdio.h to cause the above error.  Does
this mean unlocked-io.h should #include stdio.h?

Anyway, moving the #include <stdio.h> which is inside the #if TEST ...
#endif section of getdate.y to the beginning of getdate.y fixes
things.  Patch for this solution attached.  I'll submit the other if
it is deemed preferable.

Derek

- --
                *8^)

Email: address@hidden

Get CVS support at <http://ximbiot.com>!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAkCodLD1OTBfyMaQRApiEAJsHUlox4mVZH/oj50sBAw5gPxA6/wCfbDWJ
zQcCy1+h8QTdaqP8hLDbjVU=
=+j/s
-----END PGP SIGNATURE-----

Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnulib/gnulib/ChangeLog,v
retrieving revision 1.148
diff -u -p -r1.148 ChangeLog
--- ChangeLog   27 Apr 2004 22:11:37 -0000      1.148
+++ ChangeLog   28 Apr 2004 21:51:39 -0000
@@ -1,5 +1,10 @@
 2004-04-27  Derek Price  <address@hidden>
 
+       * lib/getdate.y: Move the #include of stdio.h when TEST is defined to
+       the top of the file to avoid interference from other headers.
+
+2004-04-27  Derek Price  <address@hidden>
+
        * m4/dos.m4 (gl_AC_DOS): Add Cygwin to list of Windows/DOS
        environments that accept backslashes and drive letters in paths.
 
Index: lib/getdate.y
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getdate.y,v
retrieving revision 1.81
diff -u -p -r1.81 getdate.y
--- lib/getdate.y       31 Mar 2004 07:20:49 -0000      1.81
+++ lib/getdate.y       28 Apr 2004 21:51:39 -0000
@@ -37,6 +37,10 @@
 # include <config.h>
 #endif
 
+#if TEST
+# include <stdio.h>
+#endif /* TEST */
+
 #include "getdate.h"
 
 #include <alloca.h>
@@ -1247,8 +1251,6 @@ get_date (struct timespec *result, char 
 }
 
 #if TEST
-
-#include <stdio.h>
 
 int
 main (int ac, char **av)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]