Article View: gnu.gcc.help
Article #46560[Q]: strcmp, strcpy conflicting definitions?
From: Michael Meissner
Date: Tue, 08 Nov 1994 14:56
Date: Tue, 08 Nov 1994 14:56
48 lines
2766 bytes
2766 bytes
| Hi there-- | | I'm using version 2.6.0 of the gcc product with the excellent | C matrix macro package Meschach. My problem is this: when I include | the standard Mescach headers, which then include the standard ANSI C | headers, I get a warning like this: | | matrix.h: warning: Conflicting types for built-in function strcmp | | (it's actually much longer because it contains the path to the standard | gcc library). Here's the odd part--no where in any of the headers or other | code I'm using do I even *mention* strcmp or strcpy. What's odder, those | are the only two warning flags I get. | | I took out my ANSI reference and looked up strcmp and strcpy and compared | the reference prototype with the prototype in the library. They checked | out. ANd let me just reiterate: I ripped through *every* file that | might, somehow, wind up included in my programand did a grep strcmp | on it. Nix. | | So how can I have conflicting types for a function that only gets | defined once, in a standard header? And why just those two functions? Because the compiler knows about certain function calling sequences in order to provide builtin support. It is complaining that the internal prototype it knows about is different from the version in the header file. Off hand, I suspect that your header file declares them as: extern char *strcpy (char *, char *); extern int strcmp (char *, char *); ie, leaving out the const, or possibly doing something even more bizarre like declaring them to take unsigned char * or void * pointers. I believe that the 'right' way to fix this problem is to provide us with changes to the fixincludes script that will fix it on your system. A workaround is to use the -fno-builtin switch, that will prevent the compiler from declaring the builtin functions internally. You might also try the newly released 2.6.1 to see if it fixes your problem. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 Old hackers never die, their bugs just increase.
Technical Details
Message-ID:
<9411081451.AA00958@pasta.osf.org>Path:
arc1-ca.pugleaf.net!nntp.gmd.de!Germany.EU.net!EU.net!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!osf.ORG!meissnerReferences:
meissner@osf.ORG (Michael Meissner)Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,56a76b6421ae73b1 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1994-11-08 06:56:19 PST Path: arc1-ca.pugleaf.net!nntp.gmd.de!Germany.EU.net!EU.net!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!osf.ORG!meissner From: meissner@osf.ORG (Michael Meissner) Newsgroups: gnu.gcc.help Subject: [Q]: strcmp, strcpy conflicting definitions? Date: 8 Nov 1994 09:56:19 -0500 Organization: GNUs Not Usenet Lines: 48 Sender: daemon@cis.ohio-state.edu Distribution: gnu Message-ID: <9411081451.AA00958@pasta.osf.org> References: meissner@osf.ORG (Michael Meissner)