Re: Trailing New Line in UDO
Date | 2015-12-14 15:30 |
From | jpff |
Subject | Re: Trailing New Line in UDO |
>>>>> "Oeyvind" == Oeyvind Brandtsegg |
Date | 2015-12-15 01:01 |
From | Oeyvind Brandtsegg |
Subject | Re: Trailing New Line in UDO |
Hi, Sorry to be a nuisance, but could you give an example where an include or macro needs to be part of a line? I'm sure there is a good reason, I would just like to understand what it is. best Oeyvind 2015-12-14 16:30 GMT+01:00 jpff |
Date | 2015-12-15 01:31 |
From | Steven Yi |
Subject | Re: Trailing New Line in UDO |
Just to add a note, I did a quick search to see what the rules are in C and found [1]. It made me think, maybe what we should do is add a warning if an included file does not have a newline to report that, same as when programming in C. On the other hand, in that same article, it looks like a different approach is taken for C++ and newlines are automatically inserted and no error is reported. The one case I could imagine for not automatically appending newlines is if the file that was included wasn't code but rather data. I think I could see both sides to adding a newline or not, but would probably tend assume a newline isn't added just from C programming experience. [1] - http://stackoverflow.com/questions/72271/no-newline-at-end-of-file-compiler-warning On Mon, Dec 14, 2015 at 8:01 PM, Oeyvind Brandtsegg |
Date | 2015-12-15 03:17 |
From | Beinan Li |
Subject | Re: Trailing New Line in UDO |
Thank you for the link and also for mentioning the case of including data, Steven. This dilemma is probably a reason why many text editors have that famous checkbox "automatically add an EOL to the end of the file if it doesn't exist". IMHO, giving a warning is better than automatically adding CR and/or LF data. Thanks, Beinan On Mon, Dec 14, 2015 at 8:31 PM, Steven Yi <stevenyi@gmail.com> wrote: Just to add a note, I did a quick search to see what the rules are in |
Date | 2015-12-15 08:09 |
From | Oeyvind Brandtsegg |
Subject | Re: Trailing New Line in UDO |
Ok. Thanks for the background on the issue. 2015-12-15 2:31 GMT+01:00 Steven Yi |