How many levels of pointers can you have?

J

jaysome

But you are not stuck with it. "-W -Wall -ansi -pedantic" converts
gcc into a standard C compiler. As I suspect you know.

I thought one of ANSI or ISO adopted the C standard in 1989 and the
other adopted it in 1990. So isn't "-ansi -pedantic" sufficient to
cover both? Are the "-W -Wall" options necessary to put gcc into a
stadnard C compiler mode?

And what is different between just "-ansi" and just "-pedantic"? And
why is it called "-pedantic"--why not call it "-iso" if that is what
it really is?

When a reference to C90 is made in this newsgroup, does it mean ANSI C
or ISO C or both?

Given all of these reasonable questions, how is any reasonable person
expected to know that "-W -Wall -ansi -pedantic" instead of just
"-ansi -pedantic" or something else (e.g., "-stdc") converts gcc into
a standard C compiler? Reading the gcc manual a couple of times
doesn't really clarify things. I guess YMMV.

Regards
 
C

Chris Hills

Flash Gordon said:
Chris Hills wrote, On 11/06/07 21:16:

I mean that is MISRA announced that the next standard would be based on
C99 and a date for it and that forced enough compilers to follow it,
then by the time the new MISRA standard came in to force it would be
one for the then current tools.

I doubt MISRA will do that. There is no point
 
F

Flash Gordon

jaysome wrote, On 12/06/07 07:07:
I thought one of ANSI or ISO adopted the C standard in 1989 and the
other adopted it in 1990. So isn't "-ansi -pedantic" sufficient to
cover both? Are the "-W -Wall" options necessary to put gcc into a
stadnard C compiler mode?

This really belongs somewhere like gnu.gcc.help, but I will answer some
of the points. For C90 compliance you just need "-ansi -pedantic", the
"-W -Wall" or "-Wextra -Wall" switches make gcc warn about a lot more
dodgy things that are usually bugs where the C standard does not require
a diagnostic.
And what is different between just "-ansi" and just "-pedantic"? And
why is it called "-pedantic"--why not call it "-iso" if that is what
it really is?

-ansi enables some of the C90 compliance, -pedantic enables a separate
collection of compliance features, so you need both. Basically, it seems
that some people on the GCC development team think some parts of the
standard are going too far, so they did -ansi to enable what they wanted
and -pedantic to enable the additional stuff which they think people
should not want.
When a reference to C90 is made in this newsgroup, does it mean ANSI C
or ISO C or both?

Both since ANSI C89 and ISO C90 describe the same language.
Given all of these reasonable questions, how is any reasonable person
expected to know that "-W -Wall -ansi -pedantic" instead of just
"-ansi -pedantic" or something else (e.g., "-stdc") converts gcc into
a standard C compiler? Reading the gcc manual a couple of times
doesn't really clarify things. I guess YMMV.

Well, some of us worked it out from the gcc documentation, but as for
the rest we tend to tell people how to get compilers in to standard
compliant mode where we know and also what other switches will help by
enabling more warnings.

On which subject, if you want partial C99 conformance you need to use a
different switch, but I'm too lazy to look it up this morning :)
 
K

Keith Thompson

jaysome said:
I thought one of ANSI or ISO adopted the C standard in 1989 and the
other adopted it in 1990. So isn't "-ansi -pedantic" sufficient to
cover both? Are the "-W -Wall" options necessary to put gcc into a
stadnard C compiler mode?

Questions about gcc should probably be asked in gnu.gcc.help, but
since this relates to ISO C conformance (and gcc's possible influence
on C99 adoption), it's at least partly topical here.

ANSI produced the first C standard in 1989 (C89). ISO adopted that
same standard in 1990, with some editorial changes (C90); ANSI then
adopted the ISO C90 standard. The ANSI C89 and ISO C90 standards are
two documents that describe exactly the same language.

ISO produced a revision of the C standard (C99) in 1999; ANSI has
adopted the ISO C99 standard.

gcc's documentation explains that "-ansi" causes it to "support all
ISO C89 programs" ("ISO C89" is a misnomer); it doesn't produce all
required diagnostics, though, so by itself that doesn't cause it to be
conforming. Synonyms for "-ansi" are "-std=c89", "-std=iso9899:1990".
Adding "-W -Wall -pedantic" causes gcc to produce more diagnostics.
I'm not certain which options are required to cause gcc to conform to
C90 (apart from bugs), but "-ansi -pedantic -W -Wall" comes reasonably
close as far as I know.
And what is different between just "-ansi" and just "-pedantic"? And
why is it called "-pedantic"--why not call it "-iso" if that is what
it really is?

The authors of gcc decided to call it "-pedantic", for reasons of
their own.
When a reference to C90 is made in this newsgroup, does it mean ANSI C
or ISO C or both?

Strictly speaking, neither, since the current ISO standard (and ANSI
standard) is C99. But as I said above, C89 and C90 are the same
language.
Given all of these reasonable questions, how is any reasonable person
expected to know that "-W -Wall -ansi -pedantic" instead of just
"-ansi -pedantic" or something else (e.g., "-stdc") converts gcc into
a standard C compiler? Reading the gcc manual a couple of times
doesn't really clarify things. I guess YMMV.

I think that's on the far side of the topicality boundary. Try
gnu.gcc.help.
 
J

Joachim Schmitz

Keith Thompson said:
Different people use various "bad" words with differing levels of
intensity. Some people might use "damn" only when expressing furious
rage; others might use much stronger language to denote nothing more
than mild annoyance. It's difficult to tell which is which in printed
text -- and it usually doesn't matter.

I suggest that this newsgroup works best when the participants (a) try
not to be too offensive, and (b) try not to be too easily offended.
Usually I'm not that easily offended. Guess I had a bad day.
When we can't get everyone to do both, either one will suffice, more
or less. In my humble opinion, "Default User"'s language did not
justify the lengthy discussion that it triggered. You're absolutely
entitled to feel any way you like about it, but my friendly advice is
that you should try to grow a thicker skin.
True. I'll put it to a rest then...

Bye, Jojo
 
C

Chris Dollin

Malcolm said:
I think I'm right. In practise cascading style sheets tend to entail
non-human editable HTML, which means that one is tied to a particular
editor,

That sounds like nonsense to me; I do hand-written HTML with stylesheets,
using a text editor. (Sometimes the hand-written is Ruby rhtml files, but
the principle is the same: /I/ am writing most of the HTML, not the
editor and not Ruby.)

And I'm so off-topic I'll stop.
 
D

Default User

CBFalconer said:
You need to learn to largely ignore impolite insulters here. This
is for your own good.

What about polite insulters, or impolite non-insulters?




Brian
 
H

Harald van =?UTF-8?B?RMSzaw==?=

jaysome said:
I thought one of ANSI or ISO adopted the C standard in 1989 and the
other adopted it in 1990. So isn't "-ansi -pedantic" sufficient to
cover both? Are the "-W -Wall" options necessary to put gcc into a
stadnard C compiler mode?

Yes, -ansi -pedantic is enough. -Wall -Wextra (or the older name -W) just
enable extra warnings, which are not required by any standard.
And what is different between just "-ansi" and just "-pedantic"? And
why is it called "-pedantic"--why not call it "-iso" if that is what
it really is?

When a reference to C90 is made in this newsgroup, does it mean ANSI C
or ISO C or both?

Given all of these reasonable questions, how is any reasonable person
expected to know that "-W -Wall -ansi -pedantic" instead of just
"-ansi -pedantic" or something else (e.g., "-stdc") converts gcc into
a standard C compiler? Reading the gcc manual a couple of times
doesn't really clarify things. I guess YMMV.

To quote from the GCC documentation, from the section "Language Standards
Supported by GCC":
" The original ANSI C standard (X3.159-1989) was ratified in 1989 and
published in 1990. This standard was ratified as an ISO standard
(ISO/IEC 9899:1990) later in 1990. There were no technical differences
between these publications, although the sections of the ANSI standard
were renumbered and became clauses in the ISO standard. This standard,
in both its forms, is commonly known as "C89", or occasionally as
"C90", from the dates of ratification. The ANSI standard, but not the
ISO standard, also came with a Rationale document. To select this
standard in GCC, use one of the options `-ansi', `-std=c89' or
`-std=iso9899:1990'; to obtain all the diagnostics required by the
standard, you should also specify `-pedantic' (or `-pedantic-errors' if
you want them to be errors rather than warnings). *Note Options
Controlling C Dialect: C Dialect Options. "

Note though that ANSI and ISO have both adopted C99, so when using "ANSI C"
and "ISO C" as you did, the version of the standard that is referred to
depends on the context.
 
K

Keith Thompson

Default User said:
CBFalconer wrote: [...]
You need to learn to largely ignore impolite insulters here. This
is for your own good.

What about polite insulters, or impolite non-insulters?

I humbly submit to my most learned friend that that's a stupid
question. :cool:}
 
D

Default User

Keith said:
Default User said:
CBFalconer wrote: [...]
You need to learn to largely ignore impolite insulters here. This
is for your own good.

What about polite insulters, or impolite non-insulters?

I humbly submit to my most learned friend that that's a stupid
question. :cool:}

You got your nerve, coming in here and being thoughtful and intelligent
and crap like that.




Brian
 
C

Charlton Wilbur

MMcL> So either I couldn't do the job of a junior web designer, or
MMcL> you can't do the job of an interviewer. It must be one or
MMcL> the other.

Your pages, if they are popular, are likely popular for reasons other
than their design. You might be a most excellent copywriter; you
might be an authority in your field. I'm not sure that you *can't* do
the job of a junior web designer, but your attitude makes it pretty
clear that you *won't* do the job of a junior web designer correctly.

The distinction between senior and junior web designers is that senior
web designers do things like designing CSS stylesheets and Javascript
behavior, both of which require standards-compliant HTML; if a junior
web designer can't produce standards-compliant web pages, he's a drag
on the process, and not much use at all.

Consider trying to work on a team of C programmers where the junior
programmers disregard all incidences of undefined behavior because the
compiler understands it just fine, and the senior programmers spend
half of their time cleaning up the messes left by the junior
programmers. In any sane shop, this would result in several junior
programmers looking for work. Oddly enough, in this analogous
situation, it winds p with them not being hired in the first place.

Charlton
 
F

Flash Gordon

Chris Hills wrote, On 12/06/07 07:58:
I doubt MISRA will do that. There is no point

There is a point if MISRA have enough clout to make it happen, unless
you think the current situation of the current standard not being
implemented is a good thing.

I doubt it will happen, but I think it would be a good thing if it did.
 
C

Chris Hills

Flash Gordon said:
Chris Hills wrote, On 12/06/07 07:58:

There is a point if MISRA have enough clout to make it happen, unless
you think the current situation of the current standard not being
implemented is a good thing.

MISRA is about improving the reliability of software. Not getting
involved it the ISO-C battles. MISRA-C works with what is there and in
use. Not what might be.
I doubt it will happen, but I think it would be a good thing if it did.

Why is it so important to move to C99?

C99 has not been fully implemented in the last 8 years because no one
(ie only a very small minority) really wants it.

Several senior members of the ISO-C wg have said there are features in
it they wish were not there. (Some say parts of it are broken)

The general market has not demanded it.

Compiler writers have had no [serious] pressure to conform to it.

IF you can give some very good reasons why compliance to C99 it worth
spending a lot of time and money on, when C90/5 does everything most
people need, I would be interested to see the arguments.
 
C

Chris Dollin

Chris said:
Why is it so important to move to C99?

C99 has not been fully implemented in the last 8 years because no one
(ie only a very small minority) really wants it.

I don't want /all/ of it, but I do want some features of it, and I'd
rather be able to use those features because they were part of a
widely-implemented standard rather than because the compiler I
myself personally for me am likely to use happens to make them available.

(// comments, declarations anywhere, standard booleans -- these are a
few of my favourite things.)

[It is likely that the next piece of C I write [1] will end up not being
C but C++, and that's three of the five reasons why. (Exceptions and
a subset of the class system.)]

[1] For fun, rather than part of anything I do here-at-HP.
 
1

1

This question is occur in interview. Please help me.

Dear friend, we sell all kinds of laptops and guitars . our product
is a quantity best, the price is the lowest in the world, i think you
will be interested in our product . thanks a lot! Our Website:http://
www.prs-123.com/
Msn: (e-mail address removed)
mail: (e-mail address removed)
thanks for everyone good luck with everyone .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Dear friend, we sell all kinds of laptops and guitars . our product
is a quantity best, the price is the lowest in the world, i think you
will be interested in our product . thanks a lot! Our Website:http://
www.prs-123.com/
Msn: (e-mail address removed)
mail: (e-mail address removed)
thanks for everyone good luck with everyone .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Dear friend, we sell all kinds of laptops and guitars . our product
is a quantity best, the price is the lowest in the world, i think you
will be interested in our product . thanks a lot! Our Website:http://
www.prs-123.com/
Msn: (e-mail address removed)
mail: (e-mail address removed)
thanks for everyone good luck with everyone .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Dear friend, we sell all kinds of laptops and guitars . our product
is a quantity best, the price is the lowest in the world, i think you
will be interested in our product . thanks a lot! Our Website:http://
www.prs-123.com/
Msn: (e-mail address removed)
mail: (e-mail address removed)
thanks for everyone good luck with everyone .
 
1

1

Kenneth said:
Ben Pfaff wrote:
"At least 12."
5.2.4.1 Translation limits
1 The implementation shall be able to translate and execute at
least one program that contains at least one instance of
every one of the following limits:13)
[...]
- 12 pointer, array, and function declarators (in any
combinations) modifying an arithmetic, structure, union,
or incomplete type in a declaration
Now _there's_ a question for the standards committee... Where did
they pick the number 12 from?

Maybe all the compilers allowed "as many as you like (until we
run out of store)", except one that had a 4-bit field for
"number of indirections" in a type with the top three values
reserved for "struct", "union", or "function pointer".

--
Speculative Faction Hedgehog
Otherface: Jena RDF/Owl toolkithttp://jena.sourceforge.net/- -

- -

Dear friend, we sell all kinds of laptops and guitars . our product
is a quantity best, the price is the lowest in the world, i think you
will be interested in our product . thanks a lot! Our Website:http://
www.prs-123.com/
Msn: (e-mail address removed)
mail: (e-mail address removed)
thanks for everyone good luck with everyone .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Dear friend, we sell all kinds of laptops and guitars . our product
is a quantity best, the price is the lowest in the world, i think you
will be interested in our product . thanks a lot! Our Website:http://
www.prs-123.com/
Msn: (e-mail address removed)
mail: (e-mail address removed)
thanks for everyone good luck with everyone .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Dear friend, we sell all kinds of laptops and guitars . our product
is a quantity best, the price is the lowest in the world, i think you
will be interested in our product . thanks a lot! Our Website:http://
www.prs-123.com/
Msn: (e-mail address removed)
mail: (e-mail address removed)
thanks for everyone good luck with everyone .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Dear friend, we sell all kinds of laptops and guitars . our product
is a quantity best, the price is the lowest in the world, i think you
will be interested in our product . thanks a lot! Our Website:http://
www.prs-123.com/
Msn: (e-mail address removed)
mail: (e-mail address removed)
thanks for everyone good luck with everyone .
 
N

Neil Booth

Chris said:
That is what I said.
95% of the C compilers aren't fully C99 conforming anyway.

AFAIK there are only about 6 compilers in the world that are fully C99
conforming. The other 100 odd are not to a greater or lesser extent.

By that definition there isn't even one.

You give me a C compiler, I'll give you conforming code it won't compile.
 
H

Harald van =?UTF-8?B?RMSzaw==?=

Chris said:
I think there are about 6 fully conforming C99 compilers


Which proves what?

I don't know what exactly you mean by "fully" conforming compilers. If you
mean conforming compilers that accept any correct program (or even just any
strictly conforming program), then such code would prove that the compiler
is not "fully" conforming. I'll assume you were referring to the complete
implementation (including linker, library, etc.). If you just mean
conforming implementations, or if you mean conforming hosted
implementations, then those are intentionally allowed to have bugs, and
because of that there are probably more than six conforming
implementations. If you mean something in between, would you please
clarify? I'm under the impression that you mean a conforming implementation
(or maybe a conforming hosted implementation) that meets certain minimal
QoI standards, but which standards are they?
 

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
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top