Re: Small build problem, 2a14

From: David D. Kilzer <ddkilzer_at_ti.com_at_hypermail-project.org>
Date: Wed, 17 Feb 1999 13:33:14 -0600
Message-Id: <199902171933.NAA22104_at_elbonia.rsc.raytheon.com>


If there is something #DEFINEd (like STRCPY_MACRO or even strcpy itself) in string.h for glibc-2.x, you just check to make sure that this macro is NOT set before you allow the prototype to be included. For example:

char *progname;         /* name of executable            */
char lastline[BUFSIZ];  /* read-behind  buffer           */
char s[BUFSIZ];         /* read buffer                   */
#ifndef strcpy
char *strcpy();         /* libc.a function declaration   */
#endif
char *year;
char *month;
char *configfile;

Dave

Michael Yount <csf_at_moscow.com> wrote:

>Building 2a14 from CVS (linux/i386, egcs 1.1.1, glibc 2.0.106),
>the build failed with...
>
>gcc -g -O2 -DHYPERTEST -o htestrdmsg mbox2hypermail.c
>mbox2hypermail.c:33: macro `strcpy' used without args
>make[1]: *** [htestrdmsg] Error 1
>
>The problem is that glibc 2.0.106 (and likely 2.1) defines
>strcpy as a macro through string.h, and the prototype is
>expanded.
>
>Commenting out the prototype fixed the problem in my case.
>Could someone more knowledgeable suggest a more
>elegant solution?
>
>Thanks,
>
>Michael
>csf_at_moscow.com
>
>--- archive/mbox2hypermail.c.orig Fri Feb 12 14:24:34 1999
>+++ archive/mbox2hypermail.c Fri Feb 12 14:25:49 1999
>_at_@ -30,7 +30,7 @@
> char *progname; /* name of executable */
> char lastline[BUFSIZ]; /* read-behind buffer */
> char s[BUFSIZ]; /* read buffer */
>-char *strcpy(); /* libc.a function declaration */
>+/* char *strcpy(); */ /* libc.a function declaration */
> char *year;
> char *month;
> char *configfile;
Received on Wed 17 Feb 1999 09:37:30 PM GMT

This archive was generated by hypermail 2.2.0 : Thu 22 Feb 2007 07:33:50 PM GMT GMT