C Versions Guide: C89‑C23 Features, Differences & Choosing

目次

1. Why the “C Language Version” Matters

C language has been widely used as a foundation for programming languages since its birth in the 1970s. Over its long history, various versions (standards) have been defined, and it has continued to evolve. But what does a C language “version” actually mean? And why do you need to be aware of the version? C has been for developing many systems and applications for a long time, so questions like “which version was the code written for?” and “which version does the compiler conform to?” have a major impact on code compatibility, portability, and even maintainability. In practice, the C language standards (versions) have added new features and specifications and have revised or deprecated older ones over time. For example, “variable-length arrays”, the “bool type”, and “standardized thread support” did not exist in older versions and are only available in sufficiently recent versions. Conversely, building source code written for an older standard with a compiler targeting a newer standard can produce unexpected errors or warnings. In this article, we’ll discuss C language versions from the perspective of “why they matter”, Differences between versions Key features How to choose in practice And the latest trends We’ll explain these points clearly. Whether you’re just starting to learn C or you’re an engineer using it in the field, this aims to provide useful information for anyone looking to organize their basic knowledge of C versions.

2. Basic Structure of C Language Versions and the Relationship Between Standards and Compilers

When you hear the term “version” of the C language, programming beginners might get a bit confused. Because “version” actually has two meanings. One is the version of the C language specification (standard). The other is the version of the C language compiler software.

What Is a C Language Standard (Specification) Version?

The C language standard has been established by organizations such as the International Organization for Standardization (ISO) and the American National Standards Institute (ANSI). Each standard is identified by version names like “C89”, “C99”, “C11”, “C17”, and “C23”. These versions define the rules of C language programs, such as “what syntax is allowed”, “what features are available”, and “how they behave”.

What Is a Compiler Version?

On the other hand, the “compiler” you use to write C programs (such as GCC, Clang, Visual Studio, etc.) also has its own software version. A compiler determines which C language standard it supports, and newer compilers support newer standards. For example, GCC supports C99, C11, C17, etc., depending on its version, and Visual Studio has supported many C11 features since version 2019.

Understanding the Difference Between Standards and Compilers

  • C language standard version = language rulebook
  • Compiler version = how far it follows the rulebook, the evolution of the software that provides features
These two are closely related but not the same. For instance, even a newer compiler may include non‑standard features or proprietary extensions. When developing in C, being aware of “which standard the code conforms to” and “how far the compiler you’re using supports it” leads to avoiding problems and ensuring portability.
年収訴求

3. C Language Version List and Evolution

Since its inception, the C language has undergone numerous standard revisions. Each version introduces distinctive feature additions and specification changes. Here, we explain the major versions in chronological order.

3.1 C89/C90 (ANSI C / ISO C)

The first standardized C language is “C89 (ANSI X3.159-1989)”. It was defined by the American National Standards Institute (ANSI) and later released by the International Organization for Standardization (ISO) as “C90 (ISO/IEC 9899:1990)” with essentially the same content. Features:
  • The standard library and language specifications were clarified, greatly improving the portability of C programs.
  • Function declaration syntax, type checking, and other aspects were tightened compared to the earlier “K&R C”.
  • Many fundamental syntactic constructs and standard functions were organized at this point.
Furthermore, in 1995 a revision called “C95 (ISO/IEC 9899/AMD1:1995)” was added. C95 is a small update aimed at wide character support, internationalization, and several bug fixes.

3.2 C99 (ISO/IEC 9899:1999)

C99 is a standard that significantly modernized the C language. Many features were added to improve programmer convenience. Main Additions and Changes:
  • Variable Length Arrays (VLA)
  • Single-line comments using //
  • Introduction of the standard bool type and long long int type
  • Inline functions inline
  • Support for complex numbers
  • Flexible initializer syntax (e.g., brace-enclosed array initialization)

3.3 C11 (ISO/IEC 9899:2011)

C11 is a standard that strengthens support for modern development environments and parallel processing. Main Additions and Changes:
  • Standardization of threads (multithreading) (<threads.h>)
  • Atomic operations and memory model (enhancing safety of parallel execution)
  • Addition of static assertions _Static_assert
  • Generic macro _Generic
  • Improved alignment control and Unicode support
However, some compilers lack implementations for thread features and other functionalities, so caution is required when using them.

3.4 C17/C18 (ISO/IEC 9899:2018)

C17 (sometimes referred to as C18) primarily consists of bug fixes and minor specification tweaks to C11, with no major new features. Features:
  • Focus on bug fixes and clarification of ambiguous specifications
  • In practice, it is used much like C11

3.5 C23 (ISO/IEC 9899:2024)

C23, the latest standard formalized in 2024, incorporates many new features in response to recent trends in other languages and industry demands. Main Additions and Changes:
  • Addition of the nullptr keyword (improved compatibility with C++)
  • Introduction of binary literals (e.g., 0b1010)
  • Support for the char8_t type (explicit UTF-8 type)
  • Addition and unification of standard attributes
  • Enhanced bit-manipulation functions
  • Minor syntactic refinements for better readability
C23 is expected to become the standard for future C development, but attention is needed regarding compiler support. This concludes the overview of major C language version evolution. The next chapter will discuss how to choose and apply these versions in practice.

4. How to Choose Each Version and Practical Advice

C has multiple standard versions, but when actually writing code, it’s important to be aware of which version you are using. Here we explain how to choose a version in the field, ways to avoid common pitfalls, and practical techniques useful in real work.

Basic Guidelines for Version Selection

1. Prioritize newer standards as a rule

If possible, using newer standards (C11, C17, C23) is recommended. Newer standards provide bug fixes, security improvements, and enhanced programming convenience.

2. Align with existing code and environment

However, many cases require adhering to older standards (C90/C99) for existing systems, libraries, or embedded development. In embedded contexts, compiler support may also impose constraints.

How to Check Standard Conformance

In C, you can use the preprocessor macro __STDC_VERSION to easily determine which standard the compiler supports.
#include <stdio.h>

int main(void) {
#if __STDC_VERSION__ >= 202311L
    printf("C23 (ISO/IEC 9899:2024) supported\n");
#elif __STDC_VERSION__ >= 201710L
    printf("C17/C18 supported\n");
#elif __STDC_VERSION__ >= 201112L
    printf("C11 supported\n");
#elif __STDC_VERSION__ >= 199901L
    printf("C99 supported\n");
#elif __STDC_VERSION__ >= 199409L
    printf("C95 supported\n");
#else
    printf("C89/C90 supported\n");
#endif
    return 0;
}
In this way, you can use the __STDC_VERSION__ macro to check the standard version for each environment.

Common Practical Considerations

  • Check compiler support Not all compilers fully support the latest standards. For example, GCC and Clang adopt newer standards quickly, whereas Visual Studio and embedded compilers may lag in support.
  • Sometimes you need to specify options Some compilers require an explicit standard version via command-line options to enable new features. Example: gcc -std=c11 sample.c
  • Consider portability and maintainability In large-scale or long-term projects, you may deliberately choose a slightly older standard to prioritize maintainability and portability.

Practical Guide to Version Selection

  • New projects or learning: recommend C11 or C17
  • Embedded or legacy system support: C99 or C90 are also options
  • If you want to actively use the latest features: investigate C23 support before deciding
  • Developing with multiple people/environments: share each compiler’s support status in advance
By being aware of C standard versions and choosing appropriately, you can prevent errors and incompatibility issues before they arise. Choose the optimal version based on the realities of your environment and project goals.

5. Future Trends and Beyond C23

The C language has continued to evolve with the times. In 2024, C23 was finally approved as an international standard. This article explains the key points of C23 and the outlook for future C language standards.

Formalization of C23 and Major New Features

C23 (ISO/IEC 9899:2024) incorporates many additions and improvements to meet modern needs. The notable new features and enhancements are as follows.
  • Addition of the nullptr keyword – Like in C++, nullptr can now be used as an explicit null pointer value. This improves readability and helps prevent bugs.
  • Introduction of binary literals – Previously, C could not represent binary numbers directly, but starting with C23, binary literals such as 0b1010 are allowed.
  • Addition of the char8_t type – The UTF‑8‑specific character type char8_t has been added, making multibyte character handling more intuitive.
  • Enhanced standard attributes and bit‑operation functions – New attributes aimed at readability and optimization, as well as expanded standard functions for bit manipulation, have been introduced.
  • Fine‑grained syntax and feature improvements – Numerous refinements have been made to error handling, safety, and support for modern programming styles.

Adoption Status of C23 and Future Adoption

Because the C23 specification was only released in 2024, it is not yet available in all compilers and development environments. Open‑source compilers such as GCC and Clang are gradually adding C23 support, but full implementation and widespread adoption will still take time. In practice, C11 and C17 are expected to remain the dominant standards for the foreseeable future. However, as major compilers add support over the next few years, modern development styles that leverage C23 features are expected to become more common.

Future Outlook for the C Language

The C language already has a highly stable specification—so much so that it is sometimes called a “mature” language—but it is expected to continue evolving incrementally by incorporating feedback from users and trends from other languages. Demand in areas such as AI, IoT, and embedded development remains strong, so keeping an eye on new C language versions will continue to be important. Moreover, regular revisions of the standard are likely in the future, and staying informed about the latest developments can provide a competitive edge and help avoid problems in the field.

6. Summary

C, even nearly half a century after its inception, is still used in many systems and software development environments. This is backed by the many standard revisions and evolution accumulated as “C language versions”. In this article, we have provided a broad overview of the characteristics and evolution of each C language version, as well as how to choose and considerations in practice, up to the trends of the latest standard C23.

Benefits of Being Aware of Versions

  • Improved maintainability: Clearly identifying which standard a project is based on makes future maintenance and handling of specification changes easier.
  • Ensured portability: Reusing and sharing source code across different development environments and compilers becomes easier.
  • Preventing issues: Whether running old code in a new environment or using new features, understanding version differences in advance helps avoid unexpected bugs and incompatibility problems.

Choosing a Version for Practical Use

For beginners, it is realistic to start with C99 or C11, which have a full set of standard features and abundant reference material. In production development, choose the optimal version while considering the compiler you use and the constraints of existing systems.

Considering Updates to Modern C

The latest standards like C23 may take time to adopt in the field, but they contribute to future programming efficiency and safety improvements. Going forward, it’s important to keep an eye on the evolution of C language versions and continue updating your knowledge and skills as needed. Understanding “C language versions” correctly and making choices and deployments appropriate to the situation leads to safer and more efficient development. We hope this article serves as a helpful hint for your work and learning.

7. FAQ (Frequently Asked Questions)

Here we compile the most common questions and answers about “C language versions.” The content is carefully selected to help everyone from beginners to practicing engineers resolve their doubts.

Q1. Is the compiler version the same as the C language standard version?

A. No, they differ. The version of the C language standard refers to the specification itself, such as C99, C11, C23, etc. In contrast, the compiler version indicates how the software has evolved. For example, even the latest versions of GCC or Clang will not automatically operate in standard-conforming mode unless you explicitly specify something like “-std=c11,” so be aware of that.

Q2. Is there still value in learning older standards (C90 or C95)?

A. Yes, there is. Even today, many companies and embedded development environments prioritize compatibility and legacy assets, and develop according to C90 or C95 standards. Knowing past standards is always useful for troubleshooting and maintenance.

Q3. Should I start using the latest C23 standard right away?

A. A careful assessment is required. C23 was only officially ratified in 2024, and not all compilers or development environments fully support it yet. It can be worthwhile to experiment with it in new projects or personal learning, but in production you should always verify compiler support and the overall development environment of your team.

Q4. Can I determine which standard my environment conforms to from the value of __STDC_VERSION__?

A. Yes, you can. __STDC_VERSION__ is a macro that indicates the version of the C language standard supported by the compiler. Typical values are as follows:
Macro ValueStandard Name
199409LC95
199901LC99
201112LC11
201710LC17/C18
202311LC23

Q5. Which standards are supported by Visual Studio and GCC?

A. Support varies by compiler. For example, GCC and Clang adopt newer standards (C11, C17, C23) relatively quickly, whereas Visual Studio only implements a subset of features from C11 onward. Embedded compilers show even more variation, so it’s recommended to check the official documentation for the latest information.

Q6. What are the differences between C++ and C language versions?

A. C++ is a separate language that evolved from C, and its versioning and feature addition policies differ. C++ standards (C++98, C++11, C++17, etc.) have evolved alongside C standards, but there are areas where compatibility is not complete, so treating them the same can be risky.

Q7. I’m unsure which version to learn. What do you recommend?

A. Unless you have a specific reason, it’s recommended to start with C99 or C11. They have abundant resources and are widely used in the field, making learning efficient. If you move into embedded or specialized domains, choose the version that matches your workplace or development environment. We hope this FAQ helps resolve your questions and assists in your work. Deepen your understanding of C language versions to enable safer and more efficient programming.
年収訴求