This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc warns for memmove (0, b, 0)


Thanks everyone for the help!

On 16 November 2016 at 17:52, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 16 November 2016 at 12:01, Andrew Haley wrote:
>> On 16/11/16 11:45, Prathamesh Kulkarni wrote:
>>> I am not sure though how to interpret this in context of above example.
>>
>> This is for GCC help, not general help with C.
>>
>> However,
>>
>> ISO/IEC 9899:2011
>>
>> 7.24.1 String function conventions
>>
>> 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.
>>
>
> See also "Null pointer checks may be optimized away more aggressively"
> at https://gcc.gnu.org/gcc-4.9/porting_to.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]