[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: test-memchr failure on rawhide
From: |
Ben Pfaff |
Subject: |
Re: test-memchr failure on rawhide |
Date: |
Sat, 09 May 2009 10:51:04 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> Do you mean to say that none of the functions
> memchr
> memcmp
> memcpy
> memmove
> memset
> wmemchr
> wmemcmp
> wmemcpy
> wmemmove
> wmemset
> may be called with arguments ptr = NULL and n = 0 ?
Yes. C99 7.2.21p2 says:
Where an argument declared as size_t n specifies the length
of the array for a function, n can have the value zero on a
call to that function. Unless explicitly stated otherwise
in the description of a particular function in this
subclause, pointer arguments on such a call shall still have
valid values, as described in 7.1.4.
7.1.4p1 says:
If an argument to a function has an invalid value (such as a
value outside the domain of the function, or a pointer
outside the address space of the program, or a null pointer,
or a pointer to non-modifiable storage when the
corresponding parameter is not const-qualified) or a type
(after promotion) not expected by a function with variable
number of arguments, the behavior is undefined.
In other words, 7.2.21 says that pointer arguments to these
functions must have valid values, and 7.1.4 says that null is an
invalid value.
--
"I don't want to learn the constitution and the declaration of
independence (marvelous poetry though it be) by heart, and worship the
flag and believe that there is a god and the dollar is its prophet."
--Maarten Wiltink in the Monastery
- Re: test-memchr failure on rawhide, (continued)
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/08
- Re: test-memchr failure on rawhide, James Youngman, 2009/05/08
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/08
- Re: test-memchr failure on rawhide, Andreas Schwab, 2009/05/09
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/09
- Re: test-memchr failure on rawhide, Andreas Schwab, 2009/05/09
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/09
- Re: test-memchr failure on rawhide, Andreas Schwab, 2009/05/09
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/11
- Re: test-memchr failure on rawhide, Andreas Schwab, 2009/05/11
- Re: test-memchr failure on rawhide,
Ben Pfaff <=
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/10
- Re: test-memchr failure on rawhide, Jim Meyering, 2009/05/11
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/11
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/12
- Re: test-memchr failure on rawhide, Eric Blake, 2009/05/12
- Re: test-memchr failure on rawhide, Jim Meyering, 2009/05/13
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/13
- Re: test-memchr failure on rawhide, Eric Blake, 2009/05/13
Re: test-memchr failure on rawhide, Jim Meyering, 2009/05/08