🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52938

(none)

#52938
From: D. Doucet
Date: Wed, 22 Apr 1992 18:59
107 lines
4102 bytes
/*
     Hello. My name is Peter Howlett and I work for a small company in
     Fredericton, New Brunswick, Canada called Atlantic Systems Group (ASG).
     I recently obtained a copy of your latest compiler GCC 2.1. It seems
     to work great except for a couple of warning messages that always get
     produced from the syntax checking on my <string.h> include header.

     I'm at a bit of a loss to explain it. I'm not sure if I'm doing something
     wrong or if its just that this compiler is a little different. We have
     a copy of GCC 1.39 that has worked wonderfully for some time now, but
     we thought we should try out g++ a bit as well.

     We are running AT&T UNIX System V R 3 on a UNISYS 80386. I compiled
     GCC 2.1 with the configuration files used from 'configure i386-att-sysv3'.
     The compilation went well without any problems (except my boss was 
     somewhat distressed at my bringing the system down to its knees for a 
     couple of hours!)

     At any rate, below are the messages that get produced from the compilers
     syntax checking on my <string.h> header file:

****************************************************************
In file included from str.c:3:
/usr/include/string.h:26: warning: conflicting types for built-in function `strlen'
/usr/include/string.h:32: warning: conflicting types for built-in function `memcpy'
****************************************************************

     I've tried getting rid of the string.h header and putting my own prototypes
     in for these functions, but none of my combinations will change any of 
     the two above messages. If I take the declartions out entirely, then
     no warnings are produced at all, (unless of course I put in -Wall as
     one of the flags to gcc). For compiling this I just use 'gcc str.c'.

     If I compile using the -traditional flag, however, these warning messages
     dont come up.

     I hope I'm not wasting your time with this. It is minor, and for now
     I have just commented out the prototypes for strlen and memcpy and
     things work well. On the other hand, I thought I'd tell you about
     it anyway since I realize you must like getting feedback from people
     using your compiler. Thanks for you time.

                    Peter Howlett
                    Atlantic Systems Group
                    douc@jupiter.csd.unb.ca

     PS. I included a copy of my <string.h> at the bottom of this note.

*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void
main()
{
    int   i;
    char  *str;

    str = ( char * ) malloc( 4096 );

    strcpy( str, "Start Here..." );
    strcat( str, "extra stuff" );

    printf( "i=%d, strlen( str )=%d\n",i,strlen(str) );
}

Following is a copy of my string.h header file.

****************************************************************
/*	Unisys U 6000 - System V - Oct 1986	*/
#ifndef string__h
#define string__h
#ident	"@(#)string.h	1.2 :/src/ctix/head/s.string.h 6/22/89 17:26:46"

/* POSIX support */
#ifndef	SIZE_T
# define SIZE_T
  typedef unsigned size_t;
#endif	/* SIZE_T */
/* POSIX support */

extern char
	*strcpy(),
	*strncpy(),
	*strcat(),
	*strncat(),
	*strchr(),
	*strrchr(),
	*strpbrk(),
	*strtok(),
	*strdup();
extern int
	strcmp(),
	strncmp(),
	strlen(),
	strspn(),
	strcspn();
extern char
	*memccpy(),
	*memchr(),
	*memcpy(),
	*memset();
extern int memcmp();
#endif /* string__h */
****************************************************************
Technical Details
Message-ID: <9204221859.AA11741@jupiter.Sun.CSD.unb.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!jupiter.sun.csd.unb.ca!douc

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,ca8ae4a29482f8a0,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-04-22 11:59:30 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!jupiter.sun.csd.unb.ca!douc
From: douc@jupiter.sun.csd.unb.ca (D. Doucet)
Subject: (none)
Message-ID: <9204221859.AA11741@jupiter.Sun.CSD.unb.ca>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 22 Apr 1992 18:59:30 GMT
Lines: 108