C C++

C Language Standards: C89, C99, C11, C17, and C23


Introduction

Since its creation in the early 1970s, the C programming language has evolved through several official standards. Each new standard introduces improvements, fixes ambiguities, and adds features while maintaining compatibility with existing code whenever possible.

Understanding the different C standards helps developers write portable programs and choose language features supported by their compiler.

What Is a C Language Standard?

A C language standard is an official specification that defines the syntax, semantics, standard library, and behavior of the C programming language.

The standard ensures that C programs behave consistently across different compilers and operating systems.

Note: Compiler vendors such as GCC, Clang, and MSVC implement these standards so that programmers can write portable C code.

Timeline of C Standards

Standard Year Description
C89 (ANSI C) 1989 First official ANSI standard.
C90 (ISO C) 1990 International adoption of ANSI C.
C95 1995 Minor revision with internationalization improvements.
C99 1999 Major language and library enhancements.
C11 2011 Added multithreading and modern language features.
C17 2018 Bug fixes and clarifications for C11.
C23 2024 Latest published C standard with language and library improvements.

C89 (ANSI C)

The first official C standard was published by the American National Standards Institute (ANSI) in 1989. It is commonly known as C89 or ANSI C.

Before C89, different compilers implemented slightly different versions of the language, making software less portable.

C89 established a common specification for:

  • Language syntax
  • Data types
  • Operators
  • Control statements
  • The C Standard Library
Tip: Many legacy C projects are still written using C89 because it is supported by virtually every C compiler.

C90 (ISO C)

In 1990, the International Organization for Standardization (ISO) adopted ANSI C with only minor editorial changes. This version is commonly referred to as C90.

For most programmers, C89 and C90 are effectively the same language.

C95

C95 was the first revision of the ISO C standard. It primarily improved internationalization and expanded the standard library.

This revision introduced:

  • Wide character library support
  • Improved localization features
  • Additional standard library headers

No major language syntax changes were introduced in C95.

C99

Published in 1999, C99 was one of the largest updates to the C language. It introduced many features that modern C programmers use today.

Major additions include:

  • bool type via stdbool.h
  • Single-line comments (//)
  • inline functions
  • Variable-length arrays (VLAs)
  • long long integer type
  • Mixed declarations and statements
  • Designated initializers
  • Improved floating-point support

Example: Single-Line Comments

Example

// This feature was introduced in C99

int number = 10;

Example: Mixed Declarations

Example

#include <stdio.h>

int main(void)
{
    printf("Hello\n");

    int x = 10;

    printf("%d\n", x);

    return 0;
}

Before C99, variables had to be declared at the beginning of a block.

C11

Released in 2011, C11 modernized the language by introducing support for multithreading, safer programming, and improved concurrency.

Some important additions include:

  • Multithreading support
  • Atomic operations
  • Static assertions
  • Anonymous structures and unions
  • Unicode character support
  • Optional bounds-checking library functions

Example: Static Assertion

Example

_Static_assert(sizeof(int) >= 4, "int must be at least 4 bytes");

Static assertions allow compile-time validation of conditions.

C17

Published in 2018, C17 (also known as C18) did not introduce major new language features.

Instead, it focused on:

  • Correcting defects found in C11
  • Clarifying ambiguous specifications
  • Improving compiler consistency

Programs written for C11 generally compile without modification under C17.

Note: C17 is considered a maintenance release rather than a feature release.

C23

C23 is the latest published version of the C language standard. It modernizes C while preserving backward compatibility with older code whenever practical.

C23 introduces numerous language improvements, library enhancements, and quality-of-life features for developers.

Some notable additions include:

  • Improved Unicode support.
  • New standard library functions.
  • Better attributes and language consistency.
  • Several deprecated features removed or updated.
  • Many defect fixes and clarifications.

As compiler support continues to improve, more developers will be able to take advantage of the features introduced in C23.

Compiler Standards

Most modern compilers allow you to choose which C standard to use during compilation.

For GCC and Clang, common options include:

Example

gcc -std=c89 program.c

gcc -std=c99 program.c

gcc -std=c11 program.c

gcc -std=c17 program.c

gcc -std=c23 program.c

Selecting a specific standard determines which language features the compiler accepts.

Comparison of Major Standards

Standard Major Focus
C89/C90 First standardized version of C.
C95 Library and internationalization improvements.
C99 Modern syntax and significant language enhancements.
C11 Concurrency, safety, and multithreading.
C17 Maintenance release with bug fixes.
C23 Modernization and additional language improvements.

Which Standard Should You Learn?

If you are new to C, learning the language using the C17 or C23 standard is generally recommended. These standards include the latest improvements while remaining largely compatible with older C code.

However, understanding older standards such as C89 and C99 is still valuable because many existing projects and embedded systems continue to use them.

Tip: If you work with legacy software, you may encounter C89 or C99 code. For new projects, C17 or C23 is typically the better choice when supported by your compiler.

Summary

The C programming language has evolved through multiple standards to improve portability, reliability, and developer productivity.

  • C89/C90 established the first official language specification.
  • C95 enhanced internationalization and the standard library.
  • C99 introduced many modern language features.
  • C11 added multithreading, atomic operations, and safer programming features.
  • C17 refined the C11 standard through bug fixes and clarifications.
  • C23 continues to modernize the language with new features and library improvements.

By understanding these standards, you can write portable, maintainable C programs and select the most appropriate language version for your projects.