c99-gcc
Compile C99 code using GCC
SYNOPSIS
c99-gcc [options] input_files... [-o output_file]
PARAMETERS
input_files...
One or more C source files (e.g., .c) or object files (e.g., .o) to be compiled or linked.
-o output_file
Specify the name of the output executable or library file. If omitted, the default is a.out.
-Idir
Add dir to the list of directories to be searched for header files.
-Ldir
Add dir to the list of directories to be searched for library files.
-llib
Link with the library named lib. For example, -lm links with libm.a or libm.so.
-Dmacro[=val]
Define a preprocessor macro. Equivalent to #define macro val in source code.
-O[level]
Set optimization level. -O0 (no optimization), -O1, -O2 (default for many distros), -O3, -Os (optimize for size).
-g
Produce debugging information in the operating system's native format (e.g., DWARF on Linux).
-Wall
Enable most common warning messages.
-Wextra
Enable additional warning messages not covered by -Wall.
-Werror
Treat all warnings as errors, stopping compilation.
-E
Run only the preprocessor stage and print the result to standard output.
-std=standard
Specify the C standard to compile against. While c99-gcc implies c99, this option can override or explicitly confirm it (e.g., -std=gnu99 for GCC extensions).
DESCRIPTION
The c99-gcc command typically acts as a convenient alias or symlink to the GNU Compiler Collection (GCC), specifically configured to enforce the ISO/IEC 9899:1999 (C99) standard for compiling C source code.
While GCC itself supports numerous C standards, c99-gcc streamlines the process of ensuring that code adheres to C99, which introduced significant features like variable length arrays (VLAs), designated initializers, the restrict keyword, and improvements to standard library functions. It abstracts away the need to explicitly pass the -std=c99 flag to GCC. Like GCC, it handles the entire compilation process, from preprocessing and compilation to assembly and linking, transforming source files into executable programs or libraries.
CAVEATS
The c99-gcc command is typically a symlink, alias, or wrapper script configured to invoke gcc -std=c99. Its availability and exact setup can vary across different Linux distributions and user environments.
While it targets C99, GCC might still enable some GNU extensions by default; for strict standard adherence, combining it with -pedantic or -pedantic-errors is recommended. Users accustomed to older C standards (like C89/C90) should be aware of C99-specific features that might break compatibility.
<I>C STANDARD COMPLIANCE AND EXTENSIONS</I>
While c99-gcc enforces the C99 standard, GCC by default might enable certain GNU extensions unless a strict standard (like -std=c99 -pedantic) is requested. Conversely, if you need GNU extensions alongside C99 features, you might explicitly define _GNU_SOURCE before including system headers or compile with -std=gnu99.
HISTORY
The GNU Compiler Collection (GCC), the underlying technology for c99-gcc, was initially developed by Richard Stallman in 1987 as a free software alternative to proprietary compilers. Over the years, GCC has evolved to support numerous programming languages and standards.
The C99 standard (ISO/IEC 9899:1999) was published in 1999, introducing significant new features to the C language. GCC quickly adopted and implemented these features. The c99-gcc command emerged as a convenient way for developers to explicitly compile C code against this specific standard, simplifying the build process by pre-setting the -std=c99 flag.