Warning: -fPIC is ignored for the purpose (all code is position-independent)

I create a shared (.DLL) library, and I continue to receive this message from the compiler (gcc):

json.c:1:0: warning: -fPIC ignored for target (all code is position independent) 

What does it mean that all code is position-independent?

What does position-specific code look like?

+6
source share
1 answer

What does it mean that all code is position-independent?

This means that on your platform all code is compiled as if -fPIC is on the command line, regardless of whether you specified it or not (and therefore the flag is redundant).

You can safely ignore this warning.

+6
source

Source: https://habr.com/ru/post/957950/


All Articles