What is the Difference between ANSI C and non-ANSI C ?

This is a discussion on What is the Difference between ANSI C and non-ANSI C ? within the C Programming forums, part of the General Programming Boards category; Hi !!, I wanted to know as to what is the difference between ANSI C and non-ANSI C ? This ...

  1. #1
    Unregistered
    Guest

    What is the Difference between ANSI C and non-ANSI C ?

    Hi !!,
    I wanted to know as to what is the difference between ANSI C and non-ANSI C ? This surely has to do something with the type of compilers used but then whats the precise difference ?
    Is the C compiler provided with Linux ANSI compliant ? I would be extremely thankful if anyone could tell me the difference.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    65
    There were a lot of compilers uncompatible with each other before a standardization was set by ANSI in 1988. For example the following code may work on some compilers and won't in others.

    printf("st" "sd" "45");

    The compatible one was
    printf("st" , "sd" , "45");

    So ANSI set standards for some basic libaries, basic keywords, language rules. Today nearly all of the compilers you will find are ANSI C compliants. This means that they all support the ANSI rules. However they may add new features which are not present in ANSI C.

    The C compiler in Linux, gcc, is also ANSI C compliant. But some improvements are made for better code generation.
    Write
    man gcc
    and see how these are arranged by various flags.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21