Re: Discussion about why GNU/Linux system upgrades cause old programs to break
Arsen Arsenović <[email protected]>
| Newsgroups | gmane.emacs.devel |
|---|---|
| Message-ID | <[email protected]> |
Richard Stallman <[email protected]> writes: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > > A C99 program is a program that complies with rules of the C99 language. > ... > > Any program passed to a C99 compiler must be a C99 program. > > Accepting that premise, it follows that the old programs some people > try to use again were not written to be C99 programs. You're saying > that recent versions of GCC are is not meant to compile those old C > programs. If a correct program of that vintage is given to GCC, it should still work, if the user passes -std=gnu89 or such. There could be many relevant details, though. For instance, old programs had a tendency to make the kind of faulty assumptions I mentioned before, because compilers once did less work, so it was easier to predict their output. A modern compiler will gladly replace, say, a loop copying int values from one pointer to another of length N with a call to memcpy, or possibly with a sequence of SIMD instructions that copy many bytes at a time from one location to another (but, the latter may end up emitting code that requires four-byte aligned pointers whereas the "naive" loop wouldn't have, because the language requires that 'int' pointers are properly aligned when accessed). > It seems the users are making a mistake when they try to do that. > > What should these users do? "Fix the program to be C99" is often not > feasible, for various reasons that users have stated. That suggestion > is not helpful. > > What can we suggest to them that is feasible for them? GCC still provides both -fpermissive (to recover old behaviour in C99 and onwards) and -std=gnu89/-std=c89 (which enable -fpermissive by default, and explicitly enables the C dialect GCC accepted by default up to version 5.1). Such things were documented as part of the GCC 14 release information, on https://gcc.gnu.org/gcc-14/porting_to.html (that page should load fine even in 'eww'). -- Arsen Arsenović
signature.asc
(application/pgp-signature, 418 B)
-----BEGIN PGP SIGNATURE----- iQECBAEWCgCqFiEE/uKz0RP8AKMWLWBhUsKUMB6ixJMFAmqAsU4bFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRGRUUyQjNEMTEzRkMwMEEzMTYyRDYw NjE1MkMyOTQzMDFFQTJDNDkzEBxhcnNlbkBhYXJzZW4ubWUACgkQUsKUMB6ixJO2 2wEAglCPAUdBeox0WyqmuaUk0XGVrqWXBEVlWDvp1OGB31wA/AqhnxK3kFHsj17d ymHRk+8UNR0tiFm1nk42bXWV+RUD =TOYW -----END PGP SIGNATURE-----