[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix strict aliasing violation
From: |
Andreas Schwab |
Subject: |
Re: [PATCH] Fix strict aliasing violation |
Date: |
Sun, 12 Apr 2020 16:18:54 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.90 (gnu/linux) |
On Apr 12 2020, Tim Rühsen wrote:
> test-dl.c: In function 'test_fn_check':
> test-dl.c:186:9: warning: ISO C forbids conversion of object pointer to
> function pointer type [-Wpedantic]
> 186 | fn_p = (test_fn)fn;
> | ^
>
> Following the code, tt basically turns down to the question "How to
> convert dlsym() return value into a function pointer correctly".
POSIX requires this to work. Since dlsym isn't part of ISO C, it
doesn't make sense to use -Wpendantic.
Andreas.
--
Andreas Schwab, SUSE Labs, address@hidden
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."