Article View: comp.lang.c++
Article #1032Re: Yet another digression (was Re: [meta] O tempora, o mores! (was Re: does an expression in a logical statement need parenthes...
From: Janis Papanagnou
Date: Wed, 25 Nov 2026 08:59
Date: Wed, 25 Nov 2026 08:59
53 lines
4240 bytes
4240 bytes
On 2026-11-25 01:50, Keith Thompson wrote: > Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes: >> On 2026-11-24 05:15, James Kuyper wrote: > [...] >>> "Whether the last line requires a terminating new-line character is >>> implementation-defined." (7.24.2p2 n3998.pdf) >> >> Working in POSIX environments, though, we have the certainty and we >> need not rely on the (yet another) uncertainty that the C-standard >> exposes here. >> >> (Personally I'm not much concerned as I'm always creating terminated >> lines in text-files. I'm also using an editor where the editor cares >> about detecting and creating correct representations in files, and >> which facilitates me to control that in (very rare) cases where I'd >> need it.) > [...] > > Here's what POSIX says. > [snip] Yes, that's what I was referring to. > > So as far as C is concerned, a non-empty file not ending in a newline > may or may not be a text file, but in POSIX it is not. And yes, > many tools will, at least by default, ensure that a created or > updated non-empty text file will end with a newline character. > > But there are text-like files that don't end in a newline character (There are text files that don't have CRs, NLs, or CR-NL at all! Have a look at fixed record files on mainframes. And then there's also occasionally been "end-of-file characters" on some systems.) You may introduce, beside [POSIX] text-file and [non-text] binary file, a third category "text-like" files, but that doesn't add anything but confusion about what those files characterize beyond the two categories given and is at best suitable to "explain" any deviation from the terms that abstain from "like" descriptions. > (or that have lines exceeding LINE_MAX bytes), and I expect the > tools I use to deal with such files reasonably, even if POSIX > does't require it. If you're operating only with tools in an own ecosystem you will likely not observe any problems. Problems arise if your data has to be processed with different tools (and also across different platforms). HTH. Janis
Technical Details
Message-ID:
<11e6812$3gtv9$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11cj4a0$23796$1@dont-email.me> <JzOdnc2k5ZGeHmD3nZ2dnZfqn_qdnZ2d@giganews.com> <11dl9ou$1p00u$1@kst.eternal-september.org> <11dm94c$21u9i$1@dont-email.me> <11dmbq9$s03n$7@dont-email.me> <11dmhg2$24tb6$1@dont-email.me> <11dmib8$s03n$9@dont-email.me> <11dmqbl$289i4$1@dont-email.me> <11dmu0s$s03n$10@dont-email.me> <11dmuv3$2a3c0$1@dont-email.me> <11dnr4c$2lhv9$1@kst.eternal-september.org> <11doth7$2vhee$1@dont-email.me> <11dqpqg$3masv$2@dont-email.me> <11drvdj$12fg$1@dont-email.me> <11dt66g$fjb5$2@dont-email.me> <11dui6a$scjp$1@dont-email.me> <SpOcnXL7lP_FgJ72nZ2dnZfqn_idnZ2d@giganews.com> <RdadnUbexs0JvZ72nZ2dnZfqnPednZ2d@giganews.com> <11e136t$f9ab$1@dont-email.me> <11e331r$2gekc$1@dont-email.me> <11e3bhk$2a7k9$1@dont-email.me> <11e5bcb$3as5s$1@kst.eternal-september.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: Yet another digression (was Re: [meta] O tempora, o mores! (was Re: does an expression in a logical statement need parenthesis for proper evaluation?)) Date: Wed, 25 Nov 2026 09:59:14 +0100 Organization: A noiseless patient Spider Lines: 53 Message-ID: <11e6812$3gtv9$1@dont-email.me> References: <11cj4a0$23796$1@dont-email.me> <JzOdnc2k5ZGeHmD3nZ2dnZfqn_qdnZ2d@giganews.com> <11dl9ou$1p00u$1@kst.eternal-september.org> <11dm94c$21u9i$1@dont-email.me> <11dmbq9$s03n$7@dont-email.me> <11dmhg2$24tb6$1@dont-email.me> <11dmib8$s03n$9@dont-email.me> <11dmqbl$289i4$1@dont-email.me> <11dmu0s$s03n$10@dont-email.me> <11dmuv3$2a3c0$1@dont-email.me> <11dnr4c$2lhv9$1@kst.eternal-september.org> <11doth7$2vhee$1@dont-email.me> <11dqpqg$3masv$2@dont-email.me> <11drvdj$12fg$1@dont-email.me> <11dt66g$fjb5$2@dont-email.me> <11dui6a$scjp$1@dont-email.me> <SpOcnXL7lP_FgJ72nZ2dnZfqn_idnZ2d@giganews.com> <RdadnUbexs0JvZ72nZ2dnZfqnPednZ2d@giganews.com> <11e136t$f9ab$1@dont-email.me> <11e331r$2gekc$1@dont-email.me> <11e3bhk$2a7k9$1@dont-email.me> <11e5bcb$3as5s$1@kst.eternal-september.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 25 Nov 2026 08:59:15 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3700713"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19frqxN4nBA8jKxBrt8wcsn"; posting-host="722895d287d0ac3fef85c8faa2c02d7f" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:3f+bKtlDYkdrvrXn1VtJYMlchrM= sha256:6vNglAcxAKqRDKxJJhtFi6H2yYYUYphixBz7aIKL0k8= sha1:8JrbGOpvz0hFfCOdLc7meBCIYR8= sha256:mQYmUZMGrdmQyvDoKbbqkwreYJUDOTKCHBO3/rZa174= Content-Language: en-US In-Reply-To: <11e5bcb$3as5s$1@kst.eternal-september.org>