This is the mail archive of the mailing list for the glibc 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: RFC: Fix powerpc64 build with GCC 5.0

On 31-12-2014 17:01, Adhemerval Zanella wrote:
> On 30-12-2014 18:46, Joseph Myers wrote:
>> On Tue, 30 Dec 2014, Adhemerval Zanella wrote:
>>> And this comes from sysdep.h:
>>>         if (__builtin_classify_type (__arg3) != 5 && sizeof (__arg3) > 8) \
>>>           __illegally_sized_syscall_arg3 (); \
>>> My understanding is since we already testing if argument is a 'pointer_type_class'
>>> (__builtin_classify_type equal to 5), thus the sizeof test is superfluous.  Would be
>>> a correct fix to just remove these tests? Thoughts?
>> I don't think either test is superfluous.
>> The point of checking __builtin_classify_type is to avoid errors on string 
>> literal arguments, where sizeof inhibits array-to-pointer conversion (but 
>> __builtin_classify_type doesn't, so string literals count as pointers for 
>> __builtin_classify_type).
>> If __builtin_classify_type (__arg3) != 5, that means the argument - after 
>> array-to-pointer conversion - is *not* a pointer.  Pointers would never 
>> satisfy sizeof (__arg3) > 8, but non-pointers might (e.g. structures) and 
>> in that case would be invalid syscall arguments.
>> Assuming we want this checking at all (and if anything, my inclination 
>> would be that it should go in some sort of generic __check_syscall_arg 
>> macros in generic sysdeps/unix files, not be architecture-specific), my 
>> inclination would be to insert an explicit cast to (const struct timespec 
>> *) in utimensat.c, with a comment to explain why it's there.
> I see what I overlook then and I will prepare a patch using casts to cleanup
> powerpc build.  Thanks!
Using a new gcc trunk revision (219136) I am not seeing it anymore.

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