|
 |
On Sat, 29 Aug 2009 20:20:56 +0200, Warp <war### [at] tag povray org> wrote:
> Darren New <dne### [at] san rr com> wrote:
>> Hence my clarification. It's obviously a valid .h file. But is it a
>> valid .c file?
>
> According to gcc, no (although it does compile it nevertheless):
>
> > touch test.c
> > ls -l
> total 0
> -rw-r--r-- 1 warp users 0 2009-08-29 21:18 test.c
> > gcc -pedantic -c test.c
> test.c:1: warning: ISO C forbids an empty source file
> warp@a8:~/tmp/hops>ls -l
> total 4
> -rw-r--r-- 1 warp users 0 2009-08-29 21:18 test.c
> -rw-r--r-- 1 warp users 684 2009-08-29 21:18 test.o
Not everyone thinks that GCC is right about this. The only relevant part I
can find in the actual standard is "A source file that is not empty shall
end in a new-line character" (5.1.1.2.2), which seems to imply that empty
source files are OK.
--
FE
Post a reply to this message
|
 |