Bug#38178: pedantic -W -Wall
Andreas Jaeger wrote:
>
> >>>>> Stephan Kulow writes:
>
> > Package: libc6-dev
> > Version: 2.1.1-7
>
> > Hi!
>
> > I compile my C++ code with -pedantic -W -Wall to find errors in
> > it. But there are some warnings that come out of the libc headers.
> > One of them is the below. There are some others, I could give you
> > a list if you can forward/fix them :)
>
> Just send me a simple sample program that shows the behaviour.
> The following simple program doesn't give any warnings with egcs
> 1.1.2 (and if this only happens with including kde headers, the kde
> headers might be broken and I won't look at them):
>
> #include <sys/stat.h>
>
> int main (void)
> {
> }
Well, the errors I just copied were false alarm as they belong to
a bug in libltdl, which is already reported.
But the following program:
#include <stdlib.h>
#include <stdio.h>
#include <malloc.h>
#include <strings.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/socket.h>
int main(int, char**) {
return 0;
}
spots out:
In file included from test.C:4:
/usr/include/malloc.h:90: warning: declaration of `malloc(size_t)'
throws differ
ent exceptions
/usr/include/stdlib.h:474: warning: previous declaration here
/usr/include/malloc.h:93: warning: declaration of `calloc(size_t,
size_t)' throw
s different exceptions
/usr/include/stdlib.h:476: warning: previous declaration here
/usr/include/malloc.h:97: warning: declaration of `realloc(void *,
size_t)' thro
ws different exceptions
/usr/include/stdlib.h:482: warning: previous declaration here
/usr/include/malloc.h:100: warning: declaration of `free(void *)' throws
differe
nt exceptions
/usr/include/stdlib.h:484: warning: previous declaration here
/usr/include/malloc.h:103: warning: declaration of `cfree(void *)'
throws differ
ent exceptions
/usr/include/stdlib.h:488: warning: previous declaration here
/usr/include/malloc.h:109: warning: declaration of `valloc(size_t)'
throws diffe
rent exceptions
/usr/include/stdlib.h:497: warning: previous declaration here
In file included from /usr/include/sys/socket.h:34,
from test.C:9:
/usr/include/bits/socket.h:206: warning: ANSI C++ forbids zero-size
array `__cms
g_data'
Greetings, Stephan
--
Und sie nannten ihn, wie er selbst unterschrieb -
Den Trojanischen Pferdedieb
Reply to: