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. ]]]
>
>   > First, Emacs 24 was not a C99 program.
>
> What determines whether a program Foo is a C99 program?  And how?
> [...]
> Is it controlled by command line options?  If so, what and how?
> [...]

GCC assumes what language its input is based on the file extension and
flags the developer passed to it.

For instance, if the developer gives GCC a .c file, it will know it is
C.

Which version of C depends on the default version baked into GCC, which
is the latest version that is considered fully implemented and stable at
the moment of release.  Extensions are enabled by default also.

This version can be changed via the -std= flag.

So, as an example,  gcc -std=c99 foo.c  compiles foo.c as a C99 program
without language extensions.

gcc -std=gnu23 foo.c  or  gcc foo.c  would (at the moment; with GCC 15)
both compile these programs as C23 programs with GNU extensions enabled.

Similar goes for a .cc, .cxx, or .cpp, ... file, which are all
interpreted as C++ files (-std works much the same way).

And so on, and so forth, for the other languages supported by GCC
(details vary more in the other languages).  See (gcc) Overall Options
and (gcc) Standards.

The language guess can be overridden by the '-x' flag.  For instance,
'-x c' tells GCC that the rest of the input files are C.  But most
people just follow the conventions that are already recognized by GCC.
-- 
Arsen Arsenović
signature.asc (application/pgp-signature, 418 B)
-----BEGIN PGP SIGNATURE-----

iQECBAEWCgCqFiEE/uKz0RP8AKMWLWBhUsKUMB6ixJMFAmqAs+sbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z
Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRGRUUyQjNEMTEzRkMwMEEzMTYyRDYw
NjE1MkMyOTQzMDFFQTJDNDkzEBxhcnNlbkBhYXJzZW4ubWUACgkQUsKUMB6ixJM4
bgD+Oe52nRLucfh2h5ks8NB4sFz8qD0JU4P1vbOzv89eI2sBALMMc2Hj3VjF4rcu
I8931+VkvaGisMjsJy93yFppaRMO
=1RlT
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.