Hacker News new | past | comments | ask | show | jobs | submit login

I have one project where I run with "-pedantic -std=c99 -Wall -Wextra". The one error that pops up is:

     warning: ISO C forbids assignment between function pointer and ‘void *’ [-pedantic]
But POSIX requires that behavior (the actual target of the build). So for now, it's benign, but if the platform changes (to a non-POSIX system) then yes, it will have to be investigated.



This affects many codebases. For example, looking up functions with `dlsym` triggers this warning which is probably one of the main reasons for the POSIX requirement. It's unfortunate that GCC doesn't allow to disable only this particular warning. When writing cross-platform code, `-pedantic` is too useful to disable completely.


Try using intptr_t




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: