Debian bug report logs - #1130
Stdlib.h problems when using gcc -O-traditional

Package: libc; Reported by: tim@derwent.co.uk (Tim Morley); 103 days old.

Message received at debian-bugs:


From derwent.co.uk!tim Thu Jul 20 08:38:28 1995
Return-Path: <tim@derwent.co.uk>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sYxgB-00065hC; Thu, 20 Jul 95 08:38 PDT
Received: from rh2.derwent.co.uk by pixar.com with SMTP id AA20102
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Thu, 20 Jul 1995 08:36:39 -0700
Received: from morgoth.derwent.co.uk by rh2.derwent.co.uk with smtp 
	(SMAIL3.1.28.1#5)
	id m0sYyj0-0000czC;Thu, 20 Jul 95 16:45 GMT
Received: by morgoth.derwent.co.uk
	id <m0sYxc5-0000d8C@morgoth.derwent.co.uk>
	(Debian /\oo/\ Smail3.1.29.1 #29.32); Thu, 20 Jul 95 16:34 BST
Message-Id: <m0sYxc5-0000d8C@morgoth.derwent.co.uk>
Date: Thu, 20 Jul 95 16:34 BST
From: tim@derwent.co.uk (Tim Morley)
To: debian-bugs@pixar.com
Subject: Stdlib.h problems when using gcc -O-traditional


Package: libc
Version: 4.6.27-5

If you use 'gcc -O -traditional' and include stdlib.h it barfs about
multiple definition of a few things...

tim@morgoth:~/> cat test.c
#include <stdio.h>
#include <stdlib.h>

int main()
{
        printf("Hello world\n");
}
tim@morgoth:~/> gcc -O -traditional -o test test.c
In file included from test.c:2:
/usr/include/stdlib.h:154: conflicting types for `initstate'
/usr/include/stdlib.h:143: previous declaration of `initstate'
/usr/include/stdlib.h:156: conflicting types for `setstate'
/usr/include/stdlib.h:144: previous declaration of `setstate'
/usr/include/stdlib.h:196: conflicting types for `cfree'
/usr/include/stdlib.h:191: previous declaration of `cfree'
tim@morgoth:~/> 


An example from the stdlib.h follows:

#ifdef  __USE_MISC
/* Free a block.  An alias for `free'.  (Sun Unices).  */ 
extern void cfree __P((void * __ptr));

 #ifdef  __OPTIMIZE__
#if defined(__cplusplus) || __GNUC__ >= 2 
extern __inline void cfree (__ptr_t __ptr)
        { free (__ptr); }  
#else
#define cfree(ptr)      free(ptr)
#endif  
#endif  /* Optimizing.  */
#endif  /* Use misc.  */


It would seem that there needs to be some more checking that it
doesn't get __USE_MISC and __OPTIMIZE__ defined at the same time (or
indeed that it does the right things when it gets it!)

Tim M


Acknowledgement sent to tim@derwent.co.uk (Tim Morley):
New bug report received and forwarded. Full text available.
Report forwarded to debian-devel@pixar.com:
Bug#1130; Package libc. Full text available.
Ian Jackson / iwj10@thor.cam.ac.uk, with the debian-bugs tracking mechanism
This page last modified 07:43:01 GMT Wed 01 Nov