Does C an ISO standard?

G

Guest

Dear all,

I found in the ISO web site that C is an ISO standard. I wonder if it
refers to the requirements for implementing the C programming language and
its library (like C++), or the langauge specification (like C#)? Thanks!

Regards,
Zoe
 
J

Joona I Palaste

(e-mail address removed) scribbled the following:
Dear all,
I found in the ISO web site that C is an ISO standard. I wonder if it
refers to the requirements for implementing the C programming language and
its library (like C++), or the langauge specification (like C#)? Thanks!

AFAIK the ISO C standard is a language specification. But so is the ISO
C++ standard. Could you explain what you mean by "the requirements for
implementing the programming language and its library"?
 
G

Guest

I found in the ISO web site that C is an ISO standard. I wonder if it
AFAIK the ISO C standard is a language specification. But so is the ISO
C++ standard. Could you explain what you mean by "the requirements for
implementing the programming language and its library"?

"The requirements for implementing the programming language and its
library" - I think it should be the syntax and the semantics for C (or
others?). Will these lead to the same program behavior with different
implementations? Thanks!

Regards,
Zoe
 
J

Joona I Palaste

(e-mail address removed) scribbled the following:
"The requirements for implementing the programming language and its
library" - I think it should be the syntax and the semantics for C (or
others?). Will these lead to the same program behavior with different
implementations? Thanks!

Yes, C has an ISO standard specifying its syntax and semantics. But I
fail to see how this differs from a language specification.
Whether this leads to the same program behaviour with different
implementations depends on the conformance level of your program. If you
only use the features described in the standard, then yes. (Actually,
provisionally yes - you might run into implementation-defined stuff for
example in alignment issues.) But most OSes and compiler vendors have
their own APIs, either open or proprietary, but always non-standard. Use
of these will make your program non-portable.
 
G

Guest

Yes, C has an ISO standard specifying its syntax and semantics. But I
fail to see how this differs from a language specification.

Mm... I think a language specification should define a program's behavior
also, like the one in Java (though Java is not an ISO standard).
Whether this leads to the same program behaviour with different
implementations depends on the conformance level of your program. If you
only use the features described in the standard, then yes. (Actually,
provisionally yes - you might run into implementation-defined stuff for
example in alignment issues.) But most OSes and compiler vendors have
their own APIs, either open or proprietary, but always non-standard. Use
of these will make your program non-portable.

I see. Thanks very much! Btw, as you mentioned, C is platform dependent,
so if I only use the features described in the standard, only the C source
is portable, but not the executable.

Regards,
Zoe
 
M

Martin Ambuhl

I see. Thanks very much! Btw, as you mentioned, C is platform dependent,
so if I only use the features described in the standard, only the C source
is portable, but not the executable.

And since when is "the executable" portable for any language? If you
want to claim that some interpreted language or language compiled to
some intermediate form qualifies, then remember that the interpreter or
"engine" is part of the executable.
 
J

Joona I Palaste

(e-mail address removed) scribbled the following:
Mm... I think a language specification should define a program's behavior
also, like the one in Java (though Java is not an ISO standard).

Java is based on an official definition, but it's published by Sun, not
by ISO. So Java is not as "standardised" as C.
I see. Thanks very much! Btw, as you mentioned, C is platform dependent,
so if I only use the features described in the standard, only the C source
is portable, but not the executable.

Yes, that's right. The compiled executable form of C code is generally
not portable across implementations.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,417
Latest member
DarrenGaun

Latest Threads

Top