469,280 Members | 2,449 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,280 developers. It's quick & easy.

How many levels of pointers can you have?

This question is occur in interview. Please help me.

Jun 6 '07
158 7969
Chris Hills said:

<snip>
They are just advertised as "C compilers" not ISO 989:1999 conforming
C compilers.
The same limit applies to C90 compilers, so I don't see the point of the
distinction.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jun 9 '07 #51
>>>>"RH" == Richard Heathfield <rj*@see.sig.invalidwrites:

RHI am, however, a little surprised that you got as far as the
RHinterview stage without you yourself having found out about
RHtheir requirements. Two possibilities spring to mind - (a) a
RHwork-cultural difference between your country and mine; (b)
RHthe headhunter was lying to *you*, too. One cannot help but
RHwonder what his motivation was, though.

I'd vote for (b). I've had some miserable experiences with
recruiters; in one case, the employer was willing to offer $20,000 a
year less than the salary that the recruiter had offered me. I
discovered this in the interview, and in the end it turned out I would
have been almost comically overqualified for the job.

I've also had similar experiences to Eric Sosman; this is why I insist
on sending out my resume *only* as a PDF, and why I insist on emailing
a copy to the company myself before any interview.

I've found, too, that recruiters have a really tenuous grasp on
geography; I had one pursuing me about a year ago for a job coding web
services in Java on Windows, approximately 200 miles from where I
live. When I explained that (a) I had no programming experience with
Java; (b) my last experience with programming on the Windows platform
was in approximately 1993; and (c) I intended neither to relocate nor
commute 200 miles a day, she insisted repeatedly that this was the
opportunity of a lifetime for me. Someone else's lifetime, perhaps!

Charlton

--
Charlton Wilbur
cw*****@chromatico.net
Jun 9 '07 #52
>>>>"MMcL" == Malcolm McLean <re*******@btinternet.comwrites:

MMcLIf people are coming to you claiming two years' experience
MMcLas a C programmer developing desktop apps with Blogg's
MMcLcorps, or possessing a degree in computer studies, and
MMcLseemingly now knowing basic things, then you really need to
MMcLlook at what is going on. Whilst the candidate is trying to
MMcLsell himself and put a good gloss on his achievements,
MMcLoutright lying is relatively rare, and in Britain at least
MMcLis illegal. It could be that people are elevating trivial
MMcLexposure to something into wide experience, but then you
MMcLmight be making the mistake of saying "we need someone who
MMcLknows how to log on to Unix".

Most of the time, it's been people who overestimate their level of
ability. They know a few buzzwords and think they're experts.

The last position I interviewed candidates for was that of a junior
web designer. The idea was to find someone who understood HTML, CSS,
and a little bit of design, and could take a design and turn it into a
webpage. We got around 30 resumes.

My favorite interview question with that lot was "Why doesn't <site
from your portfoliovalidate as compliant HTML?" Now, the correct
answers are "Huh? What's that?" and "We had a constraint that made it
prohibitively expensive." Only two candidates answered correctly; one
the former, one the latter. The rest tried to explain to me that
standards compliance didn't matter, or that because Dreamweaver spit
out the HTML and it worked in Internet Explorer *of course* it was
valid, and the W3C validator was just Wrong. And this was for a job
posting that talked about standards-compliant web design explicitly.

(We hired the one who answered "huh? what's that?" -- on the theory
that it would be easier to train someone who was honest about what he
didn't know than someone who was prepared to cover up his ignorance
with a line of bafflegab.)

Charlton
--
Charlton Wilbur
cw*****@chromatico.net
Jun 9 '07 #53
>>>>"RH" == Richard Heathfield <rj*@see.sig.invalidwrites:

>> I doubt that, but anyway: what did ISO C 1989 require back
than?
> Chris is being somewhat doltish here.
RHThat's something I never really understood - what is so
RHdoltish about being *right*.

The doltishness is not in being right; the doltishness is in
recognizing that the question is about what C89 requires, and instead
of saying "ISO C was standardized in 1990, so it's ISO C90," and then
answering the question, pretending that the querent is an idiot for
not realizing that he should have asked about ANSI C 1989 or ISO C
1990.

Charlton
--
Charlton Wilbur
cw*****@chromatico.net
Jun 9 '07 #54
Charlton Wilbur wrote:

| (We hired the one who answered "huh? what's that?" -- on the theory
| that it would be easier to train someone who was honest about what
| he didn't know than someone who was prepared to cover up his
| ignorance with a line of bafflegab.)

Interesting story! Coincidentally, some of my most interesting
projects have been those I made honest efforts to back away from - on
the basis of insufficient knowledge - and ended up being hired by
people who had determined that the lack would not be a serious
obstacle. To my considerable surprise, they were all correct.
(Probably worth mentioning that they were first-level project managers
and not HR types.)

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto/
Jun 10 '07 #55
"Keith Thompson" <ks***@mib.orgschrieb im Newsbeitrag
news:ln************@nuthaus.mib.org...
"Joachim Schmitz" <no*********@schmitz-digital.dewrites:
>"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
news:Wv**************@phaedsys.demon.co.uk...
>>In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
news:V+**************@phaedsys.demon.co.uk.. .
In article <f4**********@news1.zwoll1.ov.home.nl>, Kira <as**@n.tk>
writes
>>"Kenneth Brody" <ke******@spamcop.netwrote in message
>>news:46***************@spamcop.net...
>>Ben Pfaff wrote:
>>>>
>>>madhawi <ma*******@gmail.comwrites:
>>>>
>>Subject: How many levels of pointers can you have?
>>>
>>This question is occur in interview. Please help me.
>>>>
>>>Twelve:
>>>
>>"At least 12."
>>
>>So yeah, 12 is safe everything above that is implementation defined.
>
Actually it is implementation defined anyway. Just because the
standard
says 12 it does not mean there are 12. Some common architectures may
not
support it.
Less then 12? But that wouldn't be a conforming implementation then,
would
it?

That is what I said.
95% of the C compilers aren't fully C99 conforming anyway.
So what does C89 require as the minmum?

12.

C90 5.2.4.1:

12 pointer, array, and function declarators (in any combinations)
modifying an arithmetic, a structure, a union, or an incomplete
type in a declaration
Thanks! Finaly a useful answer to what I meant to ask...

Bye, Jojo
Jun 10 '07 #56

"Charlton Wilbur" <cw*****@chromatico.netwrote in message
news:87************@mithril.chromatico.net...
>>>>>"MMcL" == Malcolm McLean <re*******@btinternet.comwrites:

MMcLIf people are coming to you claiming two years' experience
MMcLas a C programmer developing desktop apps with Blogg's
MMcLcorps, or possessing a degree in computer studies, and
MMcLseemingly now knowing basic things, then you really need to
MMcLlook at what is going on. Whilst the candidate is trying to
MMcLsell himself and put a good gloss on his achievements,
MMcLoutright lying is relatively rare, and in Britain at least
MMcLis illegal. It could be that people are elevating trivial
MMcLexposure to something into wide experience, but then you
MMcLmight be making the mistake of saying "we need someone who
MMcLknows how to log on to Unix".

Most of the time, it's been people who overestimate their level of
ability. They know a few buzzwords and think they're experts.

The last position I interviewed candidates for was that of a junior
web designer. The idea was to find someone who understood HTML, CSS,
and a little bit of design, and could take a design and turn it into a
webpage. We got around 30 resumes.

My favorite interview question with that lot was "Why doesn't <site
from your portfoliovalidate as compliant HTML?" Now, the correct
answers are "Huh? What's that?" and "We had a constraint that made it
prohibitively expensive."
I doubt my website would "validate as compliant HTML". That's because I edit
all the files in a plain text editor. It is too difficult to balance all the
tags, for instance, so I don't bother.
Since I use a very conservative subset of HTML, it is unlikely to break on
any browser, and it seems OK in all I've used. If it does break in someone's
wonderful new whizzy effort that's a pity, but it will only be one or two
people.

So the correct answer in my case is "the standards don't matter [enough]".
If it was a departmental rather than a personal site, this wouldn't be
acceptable. They have to use CSS and the like. However for a personal site,
the priority is that I can put pages up easily and edit them easily. And it
works, I've got the fifth most popular site at Leeds University.

Now actually I would be a poor candidate for junior web designer, not
because I couldn't do it but because I would want to do something more
advanced. However you are not filtering me out for the right reason, but for
an erroneous one.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Jun 10 '07 #57
Richard Heathfield wrote:
Chris Dollin said:
>Chris Hills wrote:
>>That's irrelevant the C standard is ISO 9899:1999 all other ISO C
standards are
>>technically

Indeed.
>>obsolete.
>>There is no ISO C 1989.

Historical revisionism at its finest.

Read what he said again, more carefully. There is not now, and nor has
there ever been, an ISO C 1989. This is not historical revisionism, but
historical fact.
Oops.

--
Egged Hedgehog
Meaning precedes definition.

Jun 10 '07 #58
On Jun 7, 3:59 am, Keith Thompson <k...@mib.orgwrote:
Ben Pfaff <b...@cs.stanford.eduwrites:
madhawi <madhaw...@gmail.comwrites:
Subject: How many levels of pointers can you have?
This question is occur in interview. Please help me.
Twelve:
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

Yes, but like all the limits in 5.2.4.1, it doesn't necessarily mean
very much. A conforming implementation is merely required to
translate and execute *one* program that hits all the listed limits.
Another program with 12 levels of pointers might fail to compile.

The point of the requirement, I think, is that the easiest way to
satisify it is not to have any fixed limits at all, by making the
relevant data structures within the compiler dynamic. A typical
compiler most likely won't complain about 13, or 20, or 99 levels of
pointers (unless it issues a warning).

--
Keith Thompson (The_Other_Keith) k...@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"

Thanks for the info Keith .... I did not know all these.

Jun 10 '07 #59
In article <46***************@yahoo.com>, CBFalconer
<cb********@yahoo.comwrites
>Joachim Schmitz wrote:
>"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
>>In article <f4**********@online.de>, Joachim Schmitz
... snip ...
>>>
That's irrelevant the C standard is ISO 9899:1999 all other ISO
C standards are technically obsolete.

There is no ISO C 1989.

I doubt that, but anyway: what did ISO C 1989 require back than?

Chris is being somewhat doltish here.
No just as pedantic as those on here who get VERY silly about
conformance. You can have it both ways.

There never was an ISO C89
because that version was an ANSI standard.
Ie a local US standard.
>ISO took it over, did
some paragraph renumbering, and issued it otherwise unchanged as
C90.
There was unfortunately ,in my opinion, a whole section dropped.
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #60
In article <NO*******************@fe2.news.blueyonder.co.uk >, Chris
Dollin <eh@electrichedgehog.netwrites
>Richard Heathfield wrote:
>Chris Dollin said:
>>Chris Hills wrote:

That's irrelevant the C standard is ISO 9899:1999 all other ISO C
standards are

technically

Indeed.

obsolete.

There is no ISO C 1989.

Historical revisionism at its finest.

Read what he said again, more carefully. There is not now, and nor has
there ever been, an ISO C 1989. This is not historical revisionism, but
historical fact.

Oops.
Thank you,.

There are many pedants on here trying to be holier than thou about C
conformance but play fast and loose with what standard C is. They
include K&R, ANSI, ISO and CD's

I made a comment that due to implementation there many not be 12 levels
of pointers. Getting stupid and saying "it is not C" is pointless. As I
pointed out 95% of the worlds C compilers do not conform the standard.

Being a pedant to the theoretical standards is pointless. Reality is
different.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #61
In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
>"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
news:PI**************@phaedsys.demon.co.uk...
>In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
>>>"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
news:Wv**************@phaedsys.demon.co.uk...
In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
>"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
>news:V+**************@phaedsys.demon.co.uk. ..
>In article <f4**********@news1.zwoll1.ov.home.nl>, Kira <as**@n.tk>
>writes
>>>"Kenneth Brody" <ke******@spamcop.netwrote in message
>>>news:46***************@spamcop.net...
>>>Ben Pfaff wrote:
>>>>>
>>>>madhawi <ma*******@gmail.comwrites:
>>>>>
>>>Subject: How many levels of pointers can you have?
>>>>
>>>This question is occur in interview. Please help me.
>>>>>
>>>>Twelve:
>>>>
>>>"At least 12."
>>>
>>>So yeah, 12 is safe everything above that is implementation defined.
>>
>Actually it is implementation defined anyway. Just because the
>standard
>says 12 it does not mean there are 12. Some common architectures may
>not
>support it.
>Less then 12? But that wouldn't be a conforming implementation then,
>would
>it?
>Bye, Jojo

That is what I said.
95% of the C compilers aren't fully C99 conforming anyway.
So what does C89 require as the minmum?

Bye, Jojo

That's irrelevant the C standard is ISO 9899:1999 all other ISO C
standards are technically obsolete.

There is no ISO C 1989.
I doubt that,
There is no ISO C89
The first one was ISO 9899:1990
>but anyway: what did ISO C 1989 require back than?
Nothing there saw no ISO C89

Please get the basics right before you post.
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #62
In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
>"Keith Thompson" <ks***@mib.orgschrieb im Newsbeitrag
news:ln************@nuthaus.mib.org...
>"Joachim Schmitz" <no*********@schmitz-digital.dewrites:
>>"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
news:Wv**************@phaedsys.demon.co.uk...
In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
>"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
>news:V+**************@phaedsys.demon.co.uk. ..
>In article <f4**********@news1.zwoll1.ov.home.nl>, Kira <as**@n.tk>
>writes
>>>"Kenneth Brody" <ke******@spamcop.netwrote in message
>>>news:46***************@spamcop.net...
>>>Ben Pfaff wrote:
>>>>>
>>>>madhawi <ma*******@gmail.comwrites:
>>>>>
>>>Subject: How many levels of pointers can you have?
>>>>
>>>This question is occur in interview. Please help me.
>>>>>
>>>>Twelve:
>>>>
>>>"At least 12."
>>>
>>>So yeah, 12 is safe everything above that is implementation defined.
>>
>Actually it is implementation defined anyway. Just because the
>standard
>says 12 it does not mean there are 12. Some common architectures may
>not
>support it.
>Less then 12? But that wouldn't be a conforming implementation then,
>would
>it?

That is what I said.
95% of the C compilers aren't fully C99 conforming anyway.
So what does C89 require as the minmum?

12.

C90 5.2.4.1:

12 pointer, array, and function declarators (in any combinations)
modifying an arithmetic, a structure, a union, or an incomplete
type in a declaration
Thanks! Finaly a useful answer to what I meant to ask...

Bye, Jojo
Absolutely not.

As I keep pointing out you have to check the compiler docs on each
implementation for this.

C90 is obsolete.
C99 IS the standard.

Most compilers do not meet the ISO C standard. Many implementations
deviated from C90 too.

So in REALITY you have to look at the documents to see what your C
compiler will actually do.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #63
Richard Heathfield <rj*@see.sig.invalidwrites:
Eric Sosman said:

<snip>
>I once found myself in a most embarrassing position
as an interviewee for a post I was not qualified for (nor interested
in). About five minutes into the interview, after I had answered
the Nth question in a row with "I dunno," the interviewer asked me
why in the world my resume claimed expertise in this area I was so
obviously unfamiliar with. I asked to see the resume, and to my
horror discovered that my headhunter had transformed my original
into a complete fabrication: He'd left my name intact, but just
invented most of the rest. I disavowed the fiction and promptly
on the next morning fired the headhunter -- but the damage was done;
even if the firm in question had a job for which I *was* suited, I
doubt they'd have hired me after that fiasco.

One possible defence is to take your own copy of your CV to the
interview, so that you can show it to the interviewer during your
apology (which apology, by rights, the *headhunter* should be making).

I am, however, a little surprised that you got as far as the interview
stage without you yourself having found out about their requirements.
Two possibilities spring to mind - (a) a work-cultural difference
between your country and mine; (b) the headhunter was lying to *you*,
too. One cannot help but wonder what his motivation was, though. Trying
to bang Eric-shaped pegs into non-Eric-shaped holes must surely be a
losing proposition for all concerned.
There is a third. This is a fabricated story.

You don't "fire headhunters".

Headhunters come and find you. It's why they are called Head Hunters.

No competent "Headhunter" who is looking for a specialist would do this
CV manipulation.

1) They lose all credibility
2) They would inform the candidate about the companies needs

If "headhunter" is bigging up the name for a placing agent then fair
enough - those rats would do anything for a quick placement.
>
For the record, if I'd been the interviewer I'd have said, "what, THE
Eric Sosman? Okay, never mind, we have THIS job for you instead..."
--
Jun 10 '07 #64
Chris Hills said:

<snip>
C90 is obsolete.
....but still widely employed.
C99 IS the standard.
....but hardly to be seen in mainstream implementations anywhere, after
almost eight years.
Most compilers do not meet the ISO C standard. Many implementations
deviated from C90 too.
Sure, but mostly in dark corners of little or no consequence.
>
So in REALITY you have to look at the documents to see what your C
compiler will actually do.
If we're talking REALITY, there's no point in thinking of C99 as being a
de facto standard until it actually becomes one, and there's precious
little sign of that in the REAL world.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jun 10 '07 #65
Richard said:
Richard Heathfield <rj*@see.sig.invalidwrites:
>Eric Sosman said:

<snip>
>>I once found myself in a most embarrassing position
as an interviewee for a post I was not qualified for (nor interested
in).
<snip>
>I am, however, a little surprised that you got as far as the
interview stage without you yourself having found out about their
requirements. Two possibilities spring to mind
<snip>
There is a third. This is a fabricated story.
I see no reason to doubt Eric Sosman's word. *He* has earned a solid
reputation here.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jun 10 '07 #66
In article <N5******************************@bt.com>, Richard Heathfield
<rj*@see.sig.invalidwrites
>Chris Hills said:

<snip>
>C90 is obsolete.

...but still widely employed.
Absolutely. The majority still use it. 9899:1990 + A1 and the two TC's
>C99 IS the standard.

...but hardly to be seen in mainstream implementations anywhere, after
almost eight years.
Correct. In fact I think only 6 compilers actually claim full C99
implementations. The others (how many other C compilers are there? )
are C90(95) + a bit and - some bits and some extensions.
>Most compilers do not meet the ISO C standard. Many implementations
deviated from C90 too.

Sure, but mostly in dark corners of little or no consequence.
"Mostly" which is why you Must look at the implementation notes to
check rather than assume they adhere to C90, C90+A1, C90+A1&TC's or C99
>So in REALITY you have to look at the documents to see what your C
compiler will actually do.

If we're talking REALITY, there's no point in thinking of C99 as being a
de facto standard until it actually becomes one, and there's precious
little sign of that in the REAL world.
Very true. I have said several times it will be the "standard that never
was" because whilst many C compilers are creeping towards C99 by the
time they get there it will be ISO 9899:20** they actually conform to.

That said a couple of fellow members of the C panel have said that they
expect eventually the GNU CC *implementation* (not the compilers
themselves) my well become the de-facto standard.

Many commercial C compilers can also handle the GNU C syntax and
deviations from ISO C

However in the real world if you want to know the maximum depth of
pointers look at the compiler documentation for the targets you need.
The standard is irrelevant.

If you are going to spout the crap that they are not "Conforming
compilers" please restrict your comments to the 6 ( I think ) fully ISO
C compilers there are. None of which are mainstream.
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #67
>>>>"MML" == Malcolm McLean <re*******@btinternet.comwrites:

MMLI doubt my website would "validate as compliant HTML". That's
MMLbecause I edit all the files in a plain text editor. It is
MMLtoo difficult to balance all the tags, for instance, so I
MMLdon't bother.

MMLNow actually I would be a poor candidate for junior web
MMLdesigner, not because I couldn't do it but because I would
MMLwant to do something more advanced. However you are not
MMLfiltering me out for the right reason, but for an erroneous
MMLone.

Oh, no, I think you're correct in that you'd be a poor candidate for
junior web designer. You'd be filtered out for the right reason, to
wit: "it's too much work to do it correctly."

Especially since, as any seasoned web developer will tell you, if you
don't write standard HTML, it is anybody's guess why it breaks when it
breaks. It's a perfect analogue to undefined behavior in C: it may
work perfectly on your browser, and in every browser you actually test
it in, because the brokenness of your HTML triggers the right behavior
in the compiiler you happen to be using.

And when you start to add in CSS and Javascript, it gets worse.

So no, with an attitude like that you'd be filtered out right off, and
for exactly the right reason.

Charlton
--
Charlton Wilbur
cw*****@chromatico.net
Jun 10 '07 #68
BiGYaN wrote:
Keith Thompson <k...@mib.orgwrote:
.... snip ...
>>
* --
* Keith Thompson (The_Other_Keith) k...@mib.org <http://www.ghoti.net/~kst>
* San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
* "We must do something. This is something. Therefore, we must do this."
* -- Antony Jay and Jonathan Lynn, "Yes Minister"

Thanks for the info Keith .... I did not know all these.
PLEASE at least snip sigs. That is the part following the "-- "
marker, and delineated above with '*'s. After that you hopefully
will learn to snip more.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 10 '07 #69
Chris Hills <ch***@phaedsys.orgwrites:
[...]
Very true. I have said several times it will be the "standard that
never was" because whilst many C compilers are creeping towards C99 by
the time they get there it will be ISO 9899:20** they actually conform
to.

That said a couple of fellow members of the C panel have said that
they expect eventually the GNU CC *implementation* (not the compilers
themselves) my well become the de-facto standard.
Is "implementation" the word you want here? I think you're saying
that the *language* (or dialect) implemented by gcc may well become
the de-facto standard.

Frankly, I hope that's not entirely true. To take just one example,
arithmetic on void*, particularly the way gcc implements it, is just
ugly (sizeof(void)==1???).
Many commercial C compilers can also handle the GNU C syntax and
deviations from ISO C

However in the real world if you want to know the maximum depth of
pointers look at the compiler documentation for the targets you
need. The standard is irrelevant.
And, as I've mentioned, the standard itself doesn't provide much
guidance here. A conforming compiler must accept 12 levels of
pointers in *some* program, but not necessarily in *your* program.
If you are going to spout the crap that they are not "Conforming
compilers" please restrict your comments to the 6 ( I think ) fully
ISO C compilers there are. None of which are mainstream.
But it is relevant to ask whether a given compiler conforms to the C90
(or C95) standard. ISO says otherwise, but in real life, the C90
standard is still very relevant, and most compilers support a mode in
which they conform to C90, modulo bugs.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 10 '07 #70
Chris Hills <ch***@phaedsys.orgwrites:
In article <46***************@yahoo.com>, CBFalconer
<cb********@yahoo.comwrites
>>Joachim Schmitz wrote:
>>"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
In article <f4**********@online.de>, Joachim Schmitz
... snip ...
>>>>
That's irrelevant the C standard is ISO 9899:1999 all other ISO
C standards are technically obsolete.

There is no ISO C 1989.

I doubt that, but anyway: what did ISO C 1989 require back than?

Chris is being somewhat doltish here.

No just as pedantic as those on here who get VERY silly about
conformance. You can have it both ways.
You can? Oh good! (I suspect you meant "can't".)
>There never was an ISO C89
because that version was an ANSI standard.

Ie a local US standard.
Right. But I think the context of your statement led a lot of people
(myself included, though I didn't mention it at the time) that you
would also claim that there is no ISO C 1990, i.e., that your
statement was based on the older standard being obsolete, not on the
year being off by one. That's not what you actually wrote, of course,
but it's an understandable misreading, especially given that you
typically aren't as pedantic as some of us are.
>>ISO took it over, did some paragraph renumbering, and issued it
otherwise unchanged as C90.

There was unfortunately ,in my opinion, a whole section dropped.
Oh? What section was dropped? (I have a copy of the C90 standard,
but not of the official C89 standard.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 10 '07 #71
Richard <rg****@gmail.comwrites:
[...]
>Eric Sosman said:

<snip>
>>I once found myself in a most embarrassing position
as an interviewee for a post I was not qualified for (nor interested
in).
[snip]
There is a third. This is a fabricated story.
Do you intend to imply that Eric Sosman is a liar?

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 10 '07 #72
In article <ln************@nuthaus.mib.org>, Keith Thompson
<ks***@mib.orgwrites
>Chris Hills <ch***@phaedsys.orgwrites:
>In article <46***************@yahoo.com>, CBFalconer
<cb********@yahoo.comwrites
>>>Joachim Schmitz wrote:
"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
In article <f4**********@online.de>, Joachim Schmitz

... snip ...
>
That's irrelevant the C standard is ISO 9899:1999 all other ISO
C standards are technically obsolete.
>
There is no ISO C 1989.

I doubt that, but anyway: what did ISO C 1989 require back than?

Chris is being somewhat doltish here.

No just as pedantic as those on here who get VERY silly about
conformance. You can have it both ways.

You can? Oh good! (I suspect you meant "can't".)
Yes.
>>There never was an ISO C89
because that version was an ANSI standard.

Ie a local US standard.
Right. But I think the context of your statement led a lot of people
(myself included, though I didn't mention it at the time) that you
would also claim that there is no ISO C 1990, i.e., that your
statement was based on the older standard being obsolete, not on the
year being off by one. That's not what you actually wrote, of course,
but it's an understandable misreading, especially given that you
typically aren't as pedantic as some of us are.
There IS an ISO C90. However it is one *officially* obsolete and
superseded by ISO9899:1999
the document exists and *WAS* the standard until 1999.

There never was an ISO C89 or to be pedantic ISO9899:1989
>>>ISO took it over, did some paragraph renumbering, and issued it
otherwise unchanged as C90.

There was unfortunately ,in my opinion, a whole section dropped.

Oh? What section was dropped? (I have a copy of the C90 standard,
but not of the official C89 standard.)
The rational.
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #73
In article <ln************@nuthaus.mib.org>, Keith Thompson
<ks***@mib.orgwrites
>Chris Hills <ch***@phaedsys.orgwrites:
[...]
>Very true. I have said several times it will be the "standard that
never was" because whilst many C compilers are creeping towards C99 by
the time they get there it will be ISO 9899:20** they actually conform
to.

That said a couple of fellow members of the C panel have said that
they expect eventually the GNU CC *implementation* (not the compilers
themselves) my well become the de-facto standard.

Is "implementation" the word you want here? I think you're saying
that the *language* (or dialect) implemented by gcc may well become
the de-facto standard.
Yes... I though "oh bugger! That is the wrong word" after I read it back
when it had been posted.
>Frankly, I hope that's not entirely true. To take just one example,
arithmetic on void*, particularly the way gcc implements it, is just
ugly (sizeof(void)==1???).
The problem is pragmatically speaking the Gcc dialect is very widely
spread. It is far more common than C99. Also there is a lot of freely
available source that uses the gcc dialect.
>Many commercial C compilers can also handle the GNU C syntax and
deviations from ISO C

However in the real world if you want to know the maximum depth of
pointers look at the compiler documentation for the targets you
need. The standard is irrelevant.

And, as I've mentioned, the standard itself doesn't provide much
guidance here. A conforming compiler must accept 12 levels of
pointers in *some* program, but not necessarily in *your* program.
However for many compilers they may not implement it. As there is no
legal requirement anywhere to use ISO C (ie C90- C99) compilers and as
very few do a full implementation you have the check what each one does.

For some compilers the level of nesting is difficult to do in the
architecture and as pragmatically many will not want more than 3 or 4
levels of indirection it *may* not be implemented to 12 levels.
>If you are going to spout the crap that they are not "Conforming
compilers" please restrict your comments to the 6 ( I think ) fully
ISO C compilers there are. None of which are mainstream.

But it is relevant to ask whether a given compiler conforms to the C90
(or C95) standard.
Yes and most do in the main but even so you have to check any deviations
from the standard. Getting high and mighty about the letter of the
standard will not save you if you do not read the limits of the compiler
you are using.

Incidentally this is why RULE 1 of MISRA-C is that you must use a fully
conforming C95 compiler. It is designed to get you to have to raise a
deviation for anything not matching the ISO C 95. Thus you have to
document and be aware of the limits (and extensions) of your compiler.

Knowing the limits of the tools you are using is far more important than
knowing chapter and verse on the ISO standard. (Which is a pity)
ISO says otherwise, but in real life, the C90
standard is still very relevant, and most compilers support a mode in
which they conform to C90, modulo bugs.
Absolutely this is why MISRA-C references C90+A1+TC1&2. In the real
world (ie not clc :-) where you have to write real safety critical
programs on real hardware from 8 to 128 bit MCU's the level of
conformance, or lack of, of the "C" compiler needs to be understood and
documented.

There were some discussions as to whether MISRA-C3 should reference C99.
Any suggestions?

It really depends on where the majority of embedded compilers will be in
2 years time, If the are still C95 ish that is where MISRA-C3 will
have to be as it is pointless doing a real world standard for tools
which don't exist in the mainstream. However if the majority suddenly
rush to C99 compliance then that is where MISRA-C 3 should be,

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #74
Keith Thompson <ks***@mib.orgwrites:
Richard <rg****@gmail.comwrites:
[...]
>>Eric Sosman said:

<snip>

I once found myself in a most embarrassing position
as an interviewee for a post I was not qualified for (nor interested
in).
[snip]
>There is a third. This is a fabricated story.

Do you intend to imply that Eric Sosman is a liar?
No. maybe a storyteller. And let Eric stick up for himself you pathetic
little man.

Jun 10 '07 #75
Chris Hills said:
Keith Thompson writes
>>Chris Hills writes:
>>CBFalconer writes
<snip>
>>>>ISO took it over, did some paragraph renumbering, and issued it
otherwise unchanged as C90.

There was unfortunately ,in my opinion, a whole section dropped.

Oh? What section was dropped? (I have a copy of the C90 standard,
but not of the official C89 standard.)

The rational.
Ah, that's a shame. Never mind, though - we still have integers and
floating-point (and even complex, if you're lucky enough to have C99).

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jun 10 '07 #76
In article <87************@gmail.com>, Richard <rg****@gmail.comwrites
>Keith Thompson <ks***@mib.orgwrites:
>Richard <rg****@gmail.comwrites:
[...]
>>>Eric Sosman said:

<snip>

I once found myself in a most embarrassing position
as an interviewee for a post I was not qualified for (nor interested
in).
[snip]
>>There is a third. This is a fabricated story.

Do you intend to imply that Eric Sosman is a liar?

No. maybe a storyteller. And let Eric stick up for himself you pathetic
little man.
Keith is not a pathetic little man.
You to the other hand have yet to prove yourself
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #77
Richard said:
Keith Thompson <ks***@mib.orgwrites:
>Richard <rg****@gmail.comwrites:
[...]
<snip>
>>There is a third. This is a fabricated story.

Do you intend to imply that Eric Sosman is a liar?

No. maybe a storyteller. And let Eric stick up for himself you
pathetic little man.
Like Eric Sosman, Keith Thompson has earned an excellent reputation here
in clc. Insulting him does you no more credit than does casting doubt
on Eric's honesty. That people are prepared to "stick up for" Eric
Sosman is also indicative of the significant positive contribution he
has made to this group over many years.

I am still waiting, in vain so far, for *you* to start making a
significant positive contribution to this group.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jun 10 '07 #78
"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
news:0d**************@phaedsys.demon.co.uk...
In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
>>"Keith Thompson" <ks***@mib.orgschrieb im Newsbeitrag
news:ln************@nuthaus.mib.org...
>>"Joachim Schmitz" <no*********@schmitz-digital.dewrites:
"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
news:Wv**************@phaedsys.demon.co.uk...
In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
>>"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
>>news:V+**************@phaedsys.demon.co.uk.. .
>>In article <f4**********@news1.zwoll1.ov.home.nl>, Kira <as**@n.tk>
>>writes
>>>>"Kenneth Brody" <ke******@spamcop.netwrote in message
>>>>news:46***************@spamcop.net...
>>>>Ben Pfaff wrote:
>>>>>>
>>>>>madhawi <ma*******@gmail.comwrites:
>>>>>>
>>>>Subject: How many levels of pointers can you have?
>>>>>
>>>>This question is occur in interview. Please help me.
>>>>>>
>>>>>Twelve:
>>>>>
>>>>"At least 12."
>>>>
>>>>So yeah, 12 is safe everything above that is implementation defined.
>>>
>>Actually it is implementation defined anyway. Just because the
>>standard
>>says 12 it does not mean there are 12. Some common architectures may
>>not
>>support it.
>>Less then 12? But that wouldn't be a conforming implementation then,
>>would
>>it?
>
That is what I said.
95% of the C compilers aren't fully C99 conforming anyway.
So what does C89 require as the minmum?

12.

C90 5.2.4.1:

12 pointer, array, and function declarators (in any combinations)
modifying an arithmetic, a structure, a union, or an incomplete
type in a declaration
Thanks! Finaly a useful answer to what I meant to ask...

Bye, Jojo

Absolutely not.
Bullshit. If I have a compiler that claims to be compliant to (with?) Ansi
C89 or ISO C90, and does not support at least 12 pointers, I'd claim this a
bug in the implementation and insist on getting it fixed.
As I keep pointing out you have to check the compiler docs on each
implementation for this.
Only if I need to konw wether it supports more than the minimum required by
the standard
C90 is obsolete.
The vast majority of compilers out on the street are still only conforming
to this or ANSI C89.
C99 IS the standard.
Agreed. But mute point as there isn't much support from the compiler
vendors, unfortunatly
Most compilers do not meet the ISO C standard. Many implementations
deviated from C90 too.
Then they are not allowed to call themself compliant.
So in REALITY you have to look at the documents to see what your C
compiler will actually do.
As said earlier: only if I need stuff in excess of whatever standard the
vendor claims his compiler to comply with.

Bye, Jojo
Jun 10 '07 #79
Chris Hills <ch***@phaedsys.orgwrites:
In article <ln************@nuthaus.mib.org>, Keith Thompson
<ks***@mib.orgwrites
>>Chris Hills <ch***@phaedsys.orgwrites:
[...]
There IS an ISO C90. However it is one *officially* obsolete and
superseded by ISO9899:1999
the document exists and *WAS* the standard until 1999.

There never was an ISO C89 or to be pedantic ISO9899:1989
Yes, I think we all know that.

[...]
>>There was unfortunately ,in my opinion, a whole section dropped.

Oh? What section was dropped? (I have a copy of the C90 standard,
but not of the official C89 standard.)

The rational.
I didn't think the rationalE was actually part of the standard; I
thought it was a separate document. But in any case the rationale is
still available. (I think I used to have a copy of the C89/C90
rationale; I know I have a copy of the C99 rationale.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 10 '07 #80
Chris Hills <ch***@phaedsys.orgwrites:
In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
>>"Keith Thompson" <ks***@mib.orgschrieb im Newsbeitrag
news:ln************@nuthaus.mib.org...
>>"Joachim Schmitz" <no*********@schmitz-digital.dewrites:
[...]
>>>So what does C89 require as the minmum?

12.

C90 5.2.4.1:

12 pointer, array, and function declarators (in any combinations)
modifying an arithmetic, a structure, a union, or an incomplete
type in a declaration
Thanks! Finaly a useful answer to what I meant to ask...

Absolutely not.

As I keep pointing out you have to check the compiler docs on each
implementation for this.

C90 is obsolete.
C99 IS the standard.
Yes, yes, we know.
Most compilers do not meet the ISO C standard. Many implementations
deviated from C90 too.
Most current compilers fail to meet the C99 standard because certain
features are not (yet) implemented. Most current compilers *do* meet
the C90 standard (officially obsolete though it may be); deviations
from C90 are typically bugs, usually minor ones, not features that
have not yet been implemented.

C90 conformance is a useful concept in the real world. If a
compiler's documentation claims that it conforms to C90, I can use my
officially obsolete copy of the C90 standard to find out how the
compiler will behave. If it fails to behave as it claims to, I can
cite the C90 standard in my bug report.

That's what a standard is for, to provide a proposed contract between
implementers and users. The C90 standard, in the current state of
affairs, happens to be more useful as such a contract than the C99
standard. (I hope to see that change someday; if gcc's C99
conformance is ever completed, that might finally provide the impetus
to make it happen.)

But you know all that.
So in REALITY you have to look at the documents to see what your C
compiler will actually do.
He didn't ask what his C compiler will actually do. He asked how many
levels of pointers C89 requires. I answered the question that he
actually asked. He could have had any number of reasons for asking
it; perhaps it was just historical curiosity. Do you object to any
discussion of the C90 standard? If so, you are (uncharacteristically)
attempting to impose a far stricter topicality standard than most of
feel is appropriate.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 10 '07 #81
"Joachim Schmitz" <no*********@schmitz-digital.dewrites:
[...]
If I have a compiler that claims to be compliant to (with?) Ansi C89
or ISO C90, and does not support at least 12 pointers, I'd claim
this a bug in the implementation and insist on getting it fixed.
Such a lack of support violates the standard *only* if the vendor
cannot produce one single program that the compiler can successfully
translate and execute that uses 12 levels of pointers (as well as
meeting all the other enumerated limits).

Actually, the requirement is for "12 pointer, array, and function
declarators (in any combinations) modifying an arithmetic, structure,
union, or incomplete type in a declaration". An implementation that
supports no more than 4 of each could still be conforming.

Once again, the translation limits in C99 5.2.4.1 are defined *very*
narrowly. Their effect is to encourage implementations to be
reasonable, not to require them to be reasonable. A perverse
conforming implementation could specifically recognize the chosen
single program required in 5.2.4.1, and generate code equivalent to
"int main(void){}" (if the chosen program performs no I/O), and impose
much stricter limits on all other programs. Such an implementation
would not be very useful, and would likely be no easier to implement
than a more reasonable implementation. But I can imagine a vendor
using something like this technique to claim conformance on a platform
where some of the limits are difficult to satisfy.

Incidentally, this particular requirement did not change between C90
and C99.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 10 '07 #82
Chris Hills <ch***@phaedsys.orgwrites:
[...]
Knowing the limits of the tools you are using is far more important
than knowing chapter and verse on the ISO standard. (Which is a pity)
[...]

I agree that both are important; I don't agree that either is "far
more important" than the other.

Being familiar with the ISO C standard (not quibbling for the moment
about which one) enables me to write code that will work properly on
any conforming implementation. Finding a conforming implementation,
and verifying that it's (sufficiently) conforming, is another matter.
I can use handy extensions and/or work around deficiencies where
necesary, but the majority of my code's legality and behavior is
determined by the standard.

The standard provides a way to divide the considerable problem of
writing working code into two parts, one of which has to be done only
once.

As for knowing the limits of particular implementations, there are
other newsgroups that discuss such things (gnu.gcc.*,
comp.compilers.lcc, comp.unix.solaris, microsoft.*, etc., etc.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 10 '07 #83
In article <ln************@nuthaus.mib.org>, Keith Thompson
<ks***@mib.orgwrites
>Chris Hills <ch***@phaedsys.orgwrites:
>In article <ln************@nuthaus.mib.org>, Keith Thompson
<ks***@mib.orgwrites
>>>Chris Hills <ch***@phaedsys.orgwrites:
[...]
>There IS an ISO C90. However it is one *officially* obsolete and
superseded by ISO9899:1999
the document exists and *WAS* the standard until 1999.

There never was an ISO C89 or to be pedantic ISO9899:1989

Yes, I think we all know that.

[...]
>>>There was unfortunately ,in my opinion, a whole section dropped.

Oh? What section was dropped? (I have a copy of the C90 standard,
but not of the official C89 standard.)

The rational.

I didn't think the rationalE was actually part of the standard;
It wasn't AFAIK
>I
thought it was a separate document. But in any case the rationale is
still available. (I think I used to have a copy of the C89/C90
rationale;
The Rational was for C89. It was an ANSI working group document AFAIK it
was never an ISO document
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #84
In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
>"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
news:0d**************@phaedsys.demon.co.uk...
>In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
>>>"Keith Thompson" <ks***@mib.orgschrieb im Newsbeitrag
news:ln************@nuthaus.mib.org...
"Joachim Schmitz" <no*********@schmitz-digital.dewrites:
"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
news:Wv**************@phaedsys.demon.co.uk.. .
>In article <f4**********@online.de>, Joachim Schmitz
><no*********@schmitz-digital.dewrites
>>>"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
>>>news:V+**************@phaedsys.demon.co.uk. ..
>>>In article <f4**********@news1.zwoll1.ov.home.nl>, Kira <as**@n.tk>
>>>writes
>>>>>"Kenneth Brody" <ke******@spamcop.netwrote in message
>>>>>news:46***************@spamcop.net...
>>>>>Ben Pfaff wrote:
>>>>>>>
>>>>>>madhawi <ma*******@gmail.comwrites:
>>>>>>>
>>>>>Subject: How many levels of pointers can you have?
>>>>>>
>>>>>This question is occur in interview. Please help me.
>>>>>>>
>>>>>>Twelve:
>>>>>>
>>>>>"At least 12."
>>>>>
>>>>>So yeah, 12 is safe everything above that is implementation defined.
>>>>
>>>Actually it is implementation defined anyway. Just because the
>>>standard
>>>says 12 it does not mean there are 12. Some common architectures may
>>>not
>>>support it.
>>>Less then 12? But that wouldn't be a conforming implementation then,
>>>would
>>>it?
>>
>That is what I said.
> 95% of the C compilers aren't fully C99 conforming anyway.
So what does C89 require as the minmum?

12.

C90 5.2.4.1:

12 pointer, array, and function declarators (in any combinations)
modifying an arithmetic, a structure, a union, or an incomplete
type in a declaration
Thanks! Finaly a useful answer to what I meant to ask...

Bye, Jojo

Absolutely not.
Bullshit. If I have a compiler that claims to be compliant to (with?) Ansi
C89 or ISO C90, and does not support at least 12 pointers, I'd claim this a
bug in the implementation and insist on getting it fixed.
Then you are a complete idiot who will be ignored.
>As I keep pointing out you have to check the compiler docs on each
implementation for this.
Only if I need to konw wether it supports more than the minimum required by
the standard
Now that proves you are an idiot. You will never work in safety
critical or high reliability SW development with an attitude like that.
It is unprofessional and dangerous.
>C90 is obsolete.
The vast majority of compilers out on the street are still only conforming
to this or ANSI C89.
>C99 IS the standard.
Agreed. But mute point as there isn't much support from the compiler
vendors, unfortunatly
Why unfortunately? They are reacting to the vast majority of their
users.

A lot of the compilers use a C99 compliant front end but see no need to
make the compiler C99 compliant.

>Most compilers do not meet the ISO C standard. Many implementations
deviated from C90 too.
Then they are not allowed to call themself compliant.
They don't they just say they are C compilers.
>So in REALITY you have to look at the documents to see what your C
compiler will actually do.
As said earlier: only if I need stuff in excess of whatever standard the
vendor claims his compiler to comply with.
Bye, Jojo
They don't claim compliance. It's that simple.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #85
In article <ln************@nuthaus.mib.org>, Keith Thompson
<ks***@mib.orgwrites
>Chris Hills <ch***@phaedsys.orgwrites:
>In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
>>>"Keith Thompson" <ks***@mib.orgschrieb im Newsbeitrag
news:ln************@nuthaus.mib.org...
"Joachim Schmitz" <no*********@schmitz-digital.dewrites:
[...]
>>>>So what does C89 require as the minmum?
12.
C90 5.2.4.1:
12 pointer, array, and function declarators (in any combinations)
modifying an arithmetic, a structure, a union, or an incomplete
type in a declaration
Thanks! Finaly a useful answer to what I meant to ask...
Absolutely not.
As I keep pointing out you have to check the compiler docs on each
implementation for this.
C90 is obsolete.
C99 IS the standard.
Yes, yes, we know.
>Most compilers do not meet the ISO C standard. Many implementations
deviated from C90 too.
Most current compilers fail to meet the C99 standard because certain
features are not (yet) implemented. Most current compilers *do* meet
the C90 standard (officially obsolete though it may be); deviations
from C90 are typically bugs, usually minor ones, not features that
have not yet been implemented.
Generally true. However many 8 bit compilers do not always have the full
feature set for C90.
>C90 conformance is a useful concept in the real world.
I agree totally. It is the practical C standard in use.
>If a
compiler's documentation claims that it conforms to C90, I can use my
officially obsolete copy of the C90 standard to find out how the
compiler will behave. If it fails to behave as it claims to, I can
cite the C90 standard in my bug report.
However the documentation for the compiler will usually tell you where
the compiler differs from the standard. If they have stated that in the
manual when you send in your "bug report" they will refer you back to
the page in the manual and close the report.

If it were a certified Ada compiler you would have a point. There is no
such thing as a Certified C compiler in the same way.

There are validation reports for C compilers but these document the
differences between the compiler and the C standard (usually C90) and
how the compilers fair on various test suites including things like
Paranoia. (Which is floating point and nothing to do with the C
standard.
>That's what a standard is for, to provide a proposed contract between
implementers and users.
Sort of correct.. A "proposed" language spec. NOT a contract. The
contractual spec is the one in the compiler spec. the spec you need to
read to see the actual compiler limits.
The C90 standard, in the current state of
affairs, happens to be more useful as such a contract than the C99
standard.
I agree.
(I hope to see that change someday; if gcc's C99
conformance is ever completed, that might finally provide the impetus
to make it happen.)
I doubt it. Besides by the time the majority get close to C99 compliance
it will be C20** I expect.

Many commercial compilers use C99 complaint front ends. It is just that
the seen no need to rush to make the whole compiler c99 compliant.
>But you know all that.
>So in REALITY you have to look at the documents to see what your C
compiler will actually do.

He didn't ask what his C compiler will actually do. He asked how many
levels of pointers C89 requires. I answered the question that he
actually asked.
NO he did NOT. What he asked was :- "How many levels of pointers can you
have?"

No reference was made to ANY c standard or any compiler or environment.
The ONLY answer is:
"12 in the standard but you have to check your compiler to see what they
have actually implemented."
He could have had any number of reasons for asking
it; perhaps it was just historical curiosity.
No he stated that it was
"This question is occur in interview. Please help me. "

You have no idea if they were discussing C in general, Standard C (which
standard) , a particular compiler or environment.

If the discussion was PIC12 the answer probably will not be 12
Do you object to any
discussion of the C90 standard?
Not at all. It is the most widely used standard
>If so, you are (uncharacteristically)
attempting to impose a far stricter topicality standard than most of
feel is appropriate.
No. I said you have to check the compiler docs.
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #86
Joachim Schmitz wrote:
"Chris Hills" <ch***@phaedsys.orgschrieb im Newsbeitrag
news:0d**************@phaedsys.demon.co.uk... >

Why don't you two learn how to trim your damn quotes?


Brian

Jun 10 '07 #87
In article <ln************@nuthaus.mib.org>, Keith Thompson
<ks***@mib.orgwrites
>Chris Hills <ch***@phaedsys.orgwrites:
[...]
>Knowing the limits of the tools you are using is far more important
than knowing chapter and verse on the ISO standard. (Which is a pity)
[...]

I agree that both are important; I don't agree that either is "far
more important" than the other.
I would always put knowing the tools above the standard. But then I do a
lot with safety critical Sw so I have to know exactly how the compiler
and other tools will behave.
>Being familiar with the ISO C standard (not quibbling for the moment
about which one)
Fair enough
enables me to write code that will work properly on
any conforming implementation. Finding a conforming implementation,
and verifying that it's (sufficiently) conforming, is another matter.
Agreed. Also much Sw does not need to be portable. In fact more I know
of is not. .
>I can use handy extensions and/or work around deficiencies where
necesary, but the majority of my code's legality and behavior is
determined by the standard.
Then there will be quiet a few areas where you can't work. Also not all
departures from the standard are deficiencies Many architecture
specific extensions.
>The standard provides a way to divide the considerable problem of
writing working code into two parts, one of which has to be done only
once.
I take your point. This can work in some area.
>As for knowing the limits of particular implementations, there are
other newsgroups that discuss such things (gnu.gcc.*,
comp.compilers.lcc, comp.unix.solaris, microsoft.*, etc., etc.)
Yes. However the question was "I was asked in an interview who many
levels of indirection can you have." Without context the answer is
undefined in reality.

Drop into comp.arch.embedded or comp.realtime some time
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Jun 10 '07 #88
Chris Hills said (in a reply to Keith Thompson):

<snip>
Knowing the limits of the tools you are using is far more important
than knowing chapter and verse on the ISO standard. (Which is a pity)
It is not always possible, when writing a C program or library, to know
which tools will be used to compile it, let alone the limits of those
tools. I often find myself in this position. In such circumstances, the
limits of the tools are more or less irrelevant from the C programmer's
perspective, since they are unknowable.
>ISO says otherwise, but in real life, the C90
standard is still very relevant, and most compilers support a mode in
which they conform to C90, modulo bugs.

Absolutely this is why MISRA-C references C90+A1+TC1&2. In the real
world (ie not clc :-) where you have to write real safety critical
programs on real hardware from 8 to 128 bit MCU's the level of
conformance, or lack of, of the "C" compiler needs to be understood
and documented.
I don't know what makes you think clc isn't part of the real world.
>
There were some discussions as to whether MISRA-C3 should reference
C99. Any suggestions?
Why bother? Almost nobody uses it. Why reference an almost unused
standard? I can see why you might want to refer to C99 in, say, a
tutorial - just to make people aware that it exists and broadly what
its features are - but otherwise it seems pretty pointless.
It really depends on where the majority of embedded compilers will be
in
2 years time, If the are still C95 ish that is where MISRA-C3 will
have to be as it is pointless doing a real world standard for tools
which don't exist in the mainstream.
You make my point nicely.
However if the majority
suddenly rush to C99 compliance then that is where MISRA-C 3 should
be,
....but how likely is that?

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jun 10 '07 #89
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.orgwrote:
>Once again, the translation limits in C99 5.2.4.1 are defined *very*
narrowly. Their effect is to encourage implementations to be
reasonable, not to require them to be reasonable. A perverse
conforming implementation could specifically recognize the chosen
single program required in 5.2.4.1, and generate code equivalent to
"int main(void){}" (if the chosen program performs no I/O), and impose
much stricter limits on all other programs.
Exercise for the language lawyers:

If this script, on a system where it was able to execute successfully,
had its implementation-defined behavior defined and had a documented
program exercising all of the minimum translation requirements for which
the "translation" is correct, would it be a conforming C implementation?
Why or why not?
--------
#!/bin/sh
if [ -z "$1" ]; then
echo Usage: $0 filename
exit 0
fi

echo This program may contain a syntax error or constraint violation.
cp /bin/true a.out
--------

(V guvax, ohg unira'g irevsvrq, gung nyy V/B (vapyhqvat reebe ercbegvat)
vf nyybjrq gb snvy; vs na vzcyrzragngvba xabjf guvf jvyy unccra, gur nf-vs
ehyr fubhyq nyybj vg gb bcgvzvmr nyy fvqr-rssrpgf njnl, qvfpneq gur erghea
inyhr sebz znva, naq yrnir gur hfre jvgu n cebtenz erqhprq gb n ab-bc.
V oryvrir vg snvyf gb unaqyr #reebe qverpgvirf pbeerpgyl, gubhtu.)
dave
(it would obviously fail on every QoI measure except possibly speed, but...)

--
Dave Vandervies dj******@csclub.uwaterloo.ca

Surprise your compiler. Write better code than it asks you to.
--Keith Thompson in comp.lang.c
Jun 10 '07 #90
Chris Hills <ch***@phaedsys.orgwrites:
In article <ln************@nuthaus.mib.org>, Keith Thompson
<ks***@mib.orgwrites
>>Chris Hills <ch***@phaedsys.orgwrites:
>>In article <ln************@nuthaus.mib.org>, Keith Thompson
<ks***@mib.orgwrites
Chris Hills <ch***@phaedsys.orgwrites:
[...]
>>>>There was unfortunately ,in my opinion, a whole section dropped.

Oh? What section was dropped? (I have a copy of the C90 standard,
but not of the official C89 standard.)

The rational.

I didn't think the rationalE was actually part of the standard;

It wasn't AFAIK
>>I
thought it was a separate document. But in any case the rationale is
still available. (I think I used to have a copy of the C89/C90
rationale;

The Rational was for C89. It was an ANSI working group document AFAIK
it was never an ISO document
If it was a working group document, then it was't an ANSI standard
either, and it wasn't actually "dropped". And, as i said, it was
available; since it's non-normative, it doesn't matter much whether
it's published by ISO or not.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 10 '07 #91
In article <eM******************************@bt.com>,
Malcolm McLean <re*******@btinternet.comwrote:
>I doubt my website would "validate as compliant HTML". That's because I edit
all the files in a plain text editor. It is too difficult to balance all the
tags, for instance, so I don't bother.
If by "not balancing all the tags" you mean omitting some start and
end tags, that may be perfectly valid. Unlike XML, SGML (of which
HTML is supposed to be an example) allows many shortcuts in that
respect for the benefit of human authors.

On the other hand, if you mean things like badly-nested elements such as

<x>some<y>random</x>stuff</y>

then it's not valid.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Jun 10 '07 #92
Chris Hills <ch***@phaedsys.orgwrites:
In article <ln************@nuthaus.mib.org>, Keith Thompson
<ks***@mib.orgwrites
>>Chris Hills <ch***@phaedsys.orgwrites:
>>In article <f4**********@online.de>, Joachim Schmitz
<no*********@schmitz-digital.dewrites
"Keith Thompson" <ks***@mib.orgschrieb im Newsbeitrag
news:ln************@nuthaus.mib.org...
"Joachim Schmitz" <no*********@schmitz-digital.dewrites:
[...]
>>>>>So what does C89 require as the minmum?
12.
C90 5.2.4.1:
12 pointer, array, and function declarators (in any combinations)
modifying an arithmetic, a structure, a union, or an incomplete
type in a declaration
Thanks! Finaly a useful answer to what I meant to ask...
Absolutely not.
[snip]
>>So in REALITY you have to look at the documents to see what your C
compiler will actually do.

He didn't ask what his C compiler will actually do. He asked how many
levels of pointers C89 requires. I answered the question that he
actually asked.

NO he did NOT. What he asked was :- "How many levels of pointers can
you have?"
Please pay attention; you even quoted the question that I answered.

The *original poster* asked "How many levels of pointers can you
have?". (I didn't attempt to answer that question.)

Later in the thread, Joachim Schmitz (who is not the OP) asked:

So what does C89 require as the minmum?

That's the question I answered. The answer is 12.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 10 '07 #93
On Jun 9, 11:13 am, Charlton Wilbur <cwil...@chromatico.netwrote:
Er, you haven't seen some of the resumes I've seen, then, and
subsequently interviewed the candidates with the same name at the top
of the resume. The technical ability described on the resume may have
nothing at all to do with the technical ability possessed by the
candidate
I've been told that this is endemic in American
culture, and someone even tried to argue once
that if you did NOT lie on your resumé then you
were behaving irrationally.

Jun 10 '07 #94
Richard Heathfield wrote, On 10/06/07 22:46:
Chris Hills said (in a reply to Keith Thompson):
<snip>
>There were some discussions as to whether MISRA-C3 should reference
C99. Any suggestions?

Why bother? Almost nobody uses it. Why reference an almost unused
standard? I can see why you might want to refer to C99 in, say, a
tutorial - just to make people aware that it exists and broadly what
its features are - but otherwise it seems pretty pointless.
<snip>

I my opinion it depends on how much clout the MISRA group has. If they
can effectively force the compiler writers for the chips used in their
domain to conform to C99 then them doing so would be a good thing in my
opinion. However, if the compiler vendors will just ignore it then MISRA
should stick to C95. After all, I don't want my car failing because the
code used a C99 feature that was not properly implemented by the compiler!
--
Flash Gordon
Jun 11 '07 #95
Chris Hills wrote:
Keith Thompson wrote:
.... snip ...
>
>Frankly, I hope that's not entirely true. To take just one
example, arithmetic on void*, particularly the way gcc implements
it, is just ugly (sizeof(void)==1???).

The problem is pragmatically speaking the Gcc dialect is very
widely spread. It is far more common than C99. Also there is a
lot of freely available source that uses the gcc dialect.
But you are not stuck with it. "-W -Wall -ansi -pedantic" converts
gcc into a standard C compiler. As I suspect you know.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 11 '07 #96
Chris Hills wrote:
Keith Thompson <ks***@mib.orgwrites
.... snip ...
>
>(I hope to see that change someday; if gcc's C99 conformance is
ever completed, that might finally provide the impetus to make
it happen.)

I doubt it. Besides by the time the majority get close to C99
compliance it will be C20** I expect.

Many commercial compilers use C99 complaint front ends. It is
just that the seen no need to rush to make the whole compiler
c99 compliant.
I believe the major problem is updating all those libraries.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 11 '07 #97
>>>>"OW" == Old Wolf <ol*****@inspire.net.nzwrites:

OWI've been told that [resume padding] is endemic in American
OWculture, and someone even tried to argue once that if you did
OWNOT lie on your resumé then you were behaving irrationally.

There are so many people inflating their resumes that the resume of
someone who has not done the same will look anemic by comparison.

On the other hand, my resume is entirely truthful and includes
information on where I'm willing to work, and I can count on one or
two emails a week from recruiters who want me to work jobs I'm not
qualified for in geographically infeasible areas. I suspect the
resume-padding has gotten to such a point that nobody is reading them
at all any longer, and it has become some sort of ritual signalling
like peacock tail feathers.

Charlton
--
Charlton Wilbur
cw*****@chromatico.net
Jun 11 '07 #98
In article <87************@mithril.chromatico.net>,
Charlton Wilbur <cw*****@chromatico.netwrote:
>>>>>"OW" == Old Wolf <ol*****@inspire.net.nzwrites:

OWI've been told that [resume padding] is endemic in American
OWculture, and someone even tried to argue once that if you did
OWNOT lie on your resumé then you were behaving irrationally.

There are so many people inflating their resumes that the resume of
someone who has not done the same will look anemic by comparison.
I have a significantly higher ratio of job offers to job interviews than
most people I know.
This is mostly because I have trouble getting interviews when looking for
a job; most places where I've been interviewed have seemed to be impressed
with me. I have, on more than one occasion, been discussing this and
said something like "Maybe I need to lie more on my resume", and I've
found it disturbing how many people treat that as a serious suggestion.
(For the curious, a lightly edited version of the resume that got
me my current job is at <http://www.eskimo.com/~dj3vande/resume/>.
Compare with <http://www.seebs.net/res-p.html>.)
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca
Well, let's be fair to the lusers here. The human brain was invented at least
a couple of tens of millenia ago, and they haven't mastered that yet, either.
Telephones are way beyond their league. --Richard Bos in the SDM
Jun 11 '07 #99
Dave Vandervies wrote:
| In article <87************@mithril.chromatico.net>,
| Charlton Wilbur <cw*****@chromatico.netwrote:
||||||| "OW" == Old Wolf <ol*****@inspire.net.nzwrites:
||
||| I've been told that [resume padding] is endemic in American
||| culture, and someone even tried to argue once that if you did
||| NOT lie on your resumi then you were behaving irrationally.
||
|| There are so many people inflating their resumes that the resume of
|| someone who has not done the same will look anemic by comparison.
|
| I have a significantly higher ratio of job offers to job interviews
| than most people I know.
| This is mostly because I have trouble getting interviews when
| looking for a job; most places where I've been interviewed have
| seemed to be impressed with me. I have, on more than one occasion,
| been discussing this and said something like "Maybe I need to lie
| more on my resume", and I've found it disturbing how many people
| treat that as a serious suggestion. (For the curious, a lightly
| edited version of the resume that got
| me my current job is at <http://www.eskimo.com/~dj3vande/resume/>.
| Compare with http://www.seebs.net/res-p.html.)

I can see that I've been going about this all wrong. I think I'd best
attack http://www.iedu.com/mrd/mrd_res1.html with an axe and sprinkle
in a bit of humor.

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto/
Jun 11 '07 #100

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.