November 12th, 2013, 11:26 AM
Warning: empty translation unit
Righty Ho' ladies and Gentlemen
Another K&R coding warning for you all to take a gander at.
There will be a few posts (from me) I suspect for the next couple of days/weeks as this is a massive project I am undertaking. I would just like to clarify that I am not be lazy by foruming all of the warnings I come across its just some of these I cannot find any documentation on as I am pretty sure I am using the first ever version of CC (it's probably not that bad but when you're programming in vi because the server you're using doesn't even have vim its pretty painstaking) Sorry for all the bumf, now without further gilding the lily...
Now this is interested because the compiler message tells me this is happening in the blank space and the end of the C file, and unfortunately I do not know what it means by translation unit, I thought..
Could someone clarify if they have seen this before and what are the first things to check. I would upload code, but as it's happening in white space I don't what part to upload.
November 12th, 2013, 03:32 PM
A translation is simply a single .c file, combined with all the #include file(s) listed within it.
'empty' just means there was nothing to compile within said file.
Some scenarios for 'empty' include
- it actually is empty
- it's all one big comment, because you have a /* and no matching */
- it's all in some conditional #if foo .... #endif block covering the whole file.
November 13th, 2013, 03:00 AM
Thanks, that does seem to be the case, I'll have to look at why it's all surround by an #ifndef.