This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
7.1.3 violation?
- To: gcc at gcc dot gnu dot org
- Subject: 7.1.3 violation?
- From: Michael Price <mprice at atl dot lmco dot com>
- Date: Wed, 12 Sep 2001 11:54:23 -0400
When reading the following transcript, keep in mind that <string.h> was
never included. ISO 9899:1999 section 7.1.3 states that the library functions
are only reserved if their associated headers are included and 7.1.4 doesn't
list an exception. I could find no exception for strlen().
Why is this done?
Script started on Wed Sep 12 11:45:52 2001
$> cat test.c
#include <stddef.h>
size_t strlen(const char* str);
int
main()
{
return strlen("foo");
}
$> cat test2.c
#include <stddef.h>
size_t
strlen(const char* str)
{
return 0;
}
$> gcc -v 2>&1 | tail -1
gcc version 3.0.2 20010912 (prerelease)
$> gcc -c -Wall test.c
$> gcc -c -Wall test2.c
$> gcc test.o test2.o
$> ./a.out
$> echo $?
3
$> exit
Script done on Wed Sep 12 11:47:03 2001