Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22061

gcc compiler gives an error message but codeBlocks compiles fine [duplicate]

$
0
0
printf("sizeof(int) = %d \n ", sizeof(int));

Here is the error message I get when I use this command in linux mint

gcc fileName.c -o fileName.exe

precedence.c:13:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
     printf("sizeof(int) = %d \n ", sizeof(int));
            ^
precedence.c:14:12: warning: passing argument 1 of ‘printf’ makes pointer from integer without a cast [-Wint-conversion]
     printf(sizeof(num));

Yet this same line compiles and produces the number 4 in codeBlocks IDE?


Viewing all articles
Browse latest Browse all 22061

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>