B
Bill Buckels
Turn up your warning levels then.
But GCC already does provide a very interesting warning which to me is
irrelevant:
C:\gcc>gcc test.c -o test.exe
test.c:7:2: warning: no newline at end of file
C:\gcc>test
foo
here's the code:
#include <stdio.h>
main()
{
puts("foo");
return 0;
}
Note: do not press enter above.
Microsoft C has no problems with any of that:
C:\gcc>cl test.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42
for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
test.c
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
test.obj
C:\gcc>test
foo
Until we turne-up the Warning Level
C:\gcc>cl test.c -W4
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42
for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
test.c
test.c(4) : warning C4431: missing type specifier - int assumed. Note:
C no longer supports default-int
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
test.obj
However even --help using gcc failed to reveal how to set a higher
warning level and either one shoudl assume that gcc does not support
warning levels or considers these to be irrelevant and newlines at the
end of a file to be relevant.
Microsoft C has no problem providing information on how to use warning
levels with their compiler from the command line.
I believe that a comment was made here about trying to find someone a
better compiler. Suggest you all might want to try Microsoft C for a
better compiler
Regards,
Bill Buckels