c preprocessor - gcc warning different when using --preprocessed -


when compiling ltrace icecc run compilation problem. minimal example:

main.c

#include <assert.h>  int main(int argc, char **argv) {     assert(argc != argc);     return 0; } 

test.sh:

#!/bin/bash set -x  # 1 step compilation (no warning) gcc -wall main.c  # splitted compilation (warning) gcc -wall -e main.c -o main.i gcc -wall --preprocessed main.i 

output:

++ gcc -wall main.c ++ gcc -wall -e main.c -o main.i ++ gcc -wall --preprocessed main.i main.c: in function ‘main’: main.c:4:10: warning: self-comparison evaluates false [-wtautological-compare]       assert(argc != argc);           ^~ 

as can see result different when compiling in 1 step , when preprocessing , compiling in 2 steps. intended behavior?

i use gcc 6.3, issue appears in gcc 6.2 arm. cannot ignore this, full example uses -werror.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -