[opensuse-packaging] C99 conformance

Hello all, Jump to memccpy(3) at the bottom. It says: CONFORMING TO SVr4, 4.3BSD, C99. Now look at the following program: $ cat memccp.c #include <stdlib.h> #include <string.h> int main() { void *s, *d, *r; s = malloc(1024); d = malloc(1024); r = memccpy(s, d, 0, 1024); return 0; } And now compile it: $ gcc -std=c99 -Wall memccp.c memccp.c: In function ‘main’: memccp.c:10: warning: implicit declaration of function ‘memccpy’ memccp.c:10: warning: assignment makes pointer from integer without a cast Is this due to gcc not fully supporting C99? Would a possible solution be to remove the -std=c99 from the compile options, or would that bring other problems? -- Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org

On Thu, Jan 08, 2009 at 09:14:06AM +0100, Mads Martin Joergensen wrote:
Hello all,
Jump to memccpy(3) at the bottom. It says:
CONFORMING TO SVr4, 4.3BSD, C99.
Now look at the following program:
$ cat memccp.c #include <stdlib.h> #include <string.h>
int main() { void *s, *d, *r;
s = malloc(1024); d = malloc(1024);
r = memccpy(s, d, 0, 1024);
return 0; }
And now compile it:
$ gcc -std=c99 -Wall memccp.c memccp.c: In function ‘main’: memccp.c:10: warning: implicit declaration of function ‘memccpy’ memccp.c:10: warning: assignment makes pointer from integer without a cast
Is this due to gcc not fully supporting C99? Would a possible solution be to remove the -std=c99 from the compile options, or would that bring other problems?
If the prototype does not appear, it might just be a glibc problem... C99 handling might have been forgotten here: #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) __THROW __nonnull ((1, 2)); #endif /* SVID. */ -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org

* Marcus Meissner <meissner@suse.de> [Jan 08. 2009 09:48]:
If the prototype does not appear, it might just be a glibc problem... C99 handling might have been forgotten here:
#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) __THROW __nonnull ((1, 2)); #endif /* SVID. */
That's exactly what I thought after reading the code. Should I file bugzilla vs. glibc? -- Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org

On Thu, Jan 08, 2009 at 09:56:48AM +0100, Mads Martin Joergensen wrote:
* Marcus Meissner <meissner@suse.de> [Jan 08. 2009 09:48]:
If the prototype does not appear, it might just be a glibc problem... C99 handling might have been forgotten here:
#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) __THROW __nonnull ((1, 2)); #endif /* SVID. */
That's exactly what I thought after reading the code. Should I file bugzilla vs. glibc?
Yes, I think this might help., :) Ciao, Marcus -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org

* Marcus Meissner <meissner@suse.de> [Jan 08. 2009 09:57]:
That's exactly what I thought after reading the code. Should I file bugzilla vs. glibc?
Yes, I think this might help., :)
Bug #464365 fwiw. -- Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org

Hi Mads, Le jeudi 08 janvier 2009, Mads Martin Joergensen a écrit :
Jump to memccpy(3) at the bottom. It says:
CONFORMING TO SVr4, 4.3BSD, C99.
Now look at the following program:
$ cat memccp.c #include <stdlib.h> #include <string.h>
int main() { void *s, *d, *r;
s = malloc(1024); d = malloc(1024);
r = memccpy(s, d, 0, 1024);
return 0; }
And now compile it:
$ gcc -std=c99 -Wall memccp.c memccp.c: In function ‘main’: memccp.c:10: warning: implicit declaration of function ‘memccpy’ memccp.c:10: warning: assignment makes pointer from integer without a cast
Is this due to gcc not fully supporting C99? Would a possible solution be to remove the -std=c99 from the compile options, or would that bring other problems?
For what it's worth, the French manual page doesn't list C99 in the conformance section. So you might want to check whether memccpy is really part of C99. If it is, you might want to check when C99 was added to the manual page. Maybe the person who updated the manual page forgot to update the glibc headers accordingly. -- Jean Delvare Suse L3 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org

On Thu, 8 Jan 2009, Jean Delvare wrote:
Hi Mads,
Le jeudi 08 janvier 2009, Mads Martin Joergensen a écrit :
Jump to memccpy(3) at the bottom. It says:
CONFORMING TO SVr4, 4.3BSD, C99.
Now look at the following program:
$ cat memccp.c #include <stdlib.h> #include <string.h>
int main() { void *s, *d, *r;
s = malloc(1024); d = malloc(1024);
r = memccpy(s, d, 0, 1024);
return 0; }
And now compile it:
$ gcc -std=c99 -Wall memccp.c memccp.c: In function ‘main’: memccp.c:10: warning: implicit declaration of function ‘memccpy’ memccp.c:10: warning: assignment makes pointer from integer without a cast
Is this due to gcc not fully supporting C99? Would a possible solution be to remove the -std=c99 from the compile options, or would that bring other problems?
For what it's worth, the French manual page doesn't list C99 in the conformance section. So you might want to check whether memccpy is really part of C99. If it is, you might want to check when C99 was added to the manual page. Maybe the person who updated the manual page forgot to update the glibc headers accordingly.
Correct. memccpy is definitely not in C99. Richard. -- Richard Guenther <rguenther@suse.de> Novell / SUSE Labs SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex

* Mads Martin Joergensen <mmj@mmj.dk> [Jan 08. 2009 10:20]:
That's exactly what I thought after reading the code. Should I file bugzilla vs. glibc?
Yes, I think this might help., :)
Bug #464365 fwiw.
* Richard Guenther <rguenther@suse.de> [Jan 08. 2009 10:35]:
Correct. memccpy is definitely not in C99.
Confirmed by the man-pages maintainer who reported it fixed in next man-pages release. Bug closed--thanks for the help. -- Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (4)
-
Jean Delvare
-
Mads Martin Joergensen
-
Marcus Meissner
-
Richard Guenther