I am reading gcc preprocessing documentation, I read the following sentence ( here ):
If there is no end of line marker in the last line of any input file, the end of the file is considered an implicit sentence. The C standard states that this condition causes undefined behavior, so GCC will issue a warning message.
I am trying to make a warning by doing:
> echo -n "int main(void) {return 0;}" > test.c > gcc -Wall -Wextra -Werror test.c
But no problem, it compiles. I understand the end-of-line marker as a new-line char, but there seems to be something else.
How can I create a warning?
source share