This is the mail archive of the libc-alpha@sourceware.org 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: [PATCH] Fix aliasing violation tst-rec-dlopen


On 12/15/2015 10:30 AM, Zack Weinberg wrote:
> POSIX assumes an architecture where object and function pointers
> are interconvertible, and ...
> 
>>               The 2013 Technical Corrigendum to POSIX.1-2008 (a.k.a.
>>               POSIX.1-2013) improved matters by requiring that conforming
>>               implementations support casting 'void *' to a function pointer.
> 
> ... that was the correct thing for them to do, and the right way to write
> this program is just to use a cast.

I wrote the code in question, and I did what was historically considered
best practice, old habits die hard.

If new compilers complain then we should absolutely switch to and encourage
correct casting of function pointers to their appropriate types. It's the
only thing that makes sense.

Cheers,
Carlos.


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