Consider this code: I compile it with gcc -Wall sleep.c -o sleep with no warnings. Running it gives me time ./sleep real 0m0,001s user 0m0,001s sys 0m0,000s .1 magically becomes 0, but my question is why no warnings? I’m using stock gcc 7.3.0 in Lubuntu 18.04 Answer It’s a valid conversion – the fractional part is discarded when you convert
Tag: gcc-warning
How to print the address of a function?
I let gcc compile the following example using -Wall -pedantic: I get: Line 5 made my change the code like in line 6. What am I missing to remove the warning when printing a function’s address? Answer This is essentially the only portable way to print a function pointer.