C99 portability challenge

N

new to c

Richard said:
I'm a little puzzled by "new to c"'s question, since I can only find one
question of his about lcc-win32 in the "Google Groups" archives. In fact,
I only found one post at all by "new to c" in those archives (I guess his
latest article hasn't hit their server yet as I write this.) It asked two
questions, one of which was about portability and one of which was about
the -A -A flag combination in lcc-win32, and I don't see any sign of
either question being criticised as being off-topic.

Yes, that thread I mean. In my project I use signed short but in older
lcc-win32 sizeof(signed short) is 2 and after update sizeof(signed short)
is 4 and sizeof(short signed) still 2 but compiler warn "no type specified.
Defaulting to int" and I ask if short signed better or signed short better.

But because I use -A -A Keith Thompson say "Please stop trolling; it's not
at all amusing." and Santosh say "Nice troll by the way."

I still not know what is better, signed short or short signed, in lcc-win32.

I think lcc-win32 should be on-topic or off-topic here
but not on-topic and off-topic.
 
K

Keith Thompson

new to c said:
Yes, that thread I mean. In my project I use signed short but in older
lcc-win32 sizeof(signed short) is 2 and after update sizeof(signed short)
is 4 and sizeof(short signed) still 2 but compiler warn "no type specified.
Defaulting to int" and I ask if short signed better or signed short better.

But because I use -A -A Keith Thompson say "Please stop trolling; it's not
at all amusing." and Santosh say "Nice troll by the way."

With the quotation of what I wrote, I was able to find the article.
I'll repeat what I wrote there:

| Both signed short and short signed are valid. In my opinion signed
| short is better style.
|
| If the program and compiler output are as you say, this appears to be
| a bug in lcc-win32. You should report it in comp.compilers.lcc or
| directly to the maintainer, not here.

Note that using "signed short", as well as being better style, lets
you avoid triggering a bug in lcc-win32.

At the time, I thought you were deliberately trolling, and I explained
why I thought so:

| Your use of "-A -A -ansic", and your use of a pseudonym, make me
| suspect that you've been following the discussions here, and that
| you're already perfectly well aware of everything I've just told you.
| Please stop trolling; it's not at all amusing.

You see, we had just recently had a rather lengthy and heated
discussion about lcc-win32's behavior in the presence of type
specifiers in unusual orders. My assumption was that you had read
that discussion, and decided to try to stir things up by posting a
seemingly innocent question about it.

If you tell me that that's not the case, I'll take your word for it --
but I find it odd that you haven't actually refuted my stated
assumption.

And if you want to ask about lcc-win's "-A -A" or "-pedantic" flags,
please do so in comp.compilers.lcc, not here.
I still not know what is better, signed short or short signed, in lcc-win32.

Ok, if you insist on a simple answer, I'll give you one.

signed short is better.

Don't use short signed. Use signed short. You'll be happier.

But why do you ask? Why would it even occur to you to use short
signed in the first place? And why are you still confused after you
were given all the information you could possibly need to figure it
out for yourself?

[...]
 
R

Ron Ford

I'll grant you that a "well-defined subset of C99" *would be* a good
idea. Though I'd be much happier if all the relevant implementers
just implemented the whole language, eliminating the need for subsets.
Note that the latter is essentially what happened for C90; you don't
see many C compilers that fail to implement all of the C90 standard.

Does anyone have any doubts what is in G?

Hamburg -- er. A standard has themes that defy a low-level analysis on the
order of permutations on a word the size of "alaska."
 
T

teapot

new said:
[...] In my project I use signed short but in older
lcc-win32 sizeof(signed short) is 2 and after update sizeof(signed short)
is 4 and sizeof(short signed) still 2 but compiler warn "no type
specified. Defaulting to int" and I ask if short signed better or signed
short better.

That bug was corrected only two days after you reported it, in the
version released on July 16th (in that release it still warned on
``short signed''; but both variations had correct type and size again).

Back to $subject, what is still broken since then and should be accepted
portably in C99 (and not only there), is ``short signed int'' -- at least
up until the 2008-09-04 release it triggers a ``invalid type specification''
error and stops compilation.

(This is no criticism or anything; just a note on conformance)
 
J

jacob navia

teapot said:
new said:
[...] In my project I use signed short but in older
lcc-win32 sizeof(signed short) is 2 and after update sizeof(signed short)
is 4 and sizeof(short signed) still 2 but compiler warn "no type
specified. Defaulting to int" and I ask if short signed better or signed
short better.

That bug was corrected only two days after you reported it, in the
version released on July 16th (in that release it still warned on
``short signed''; but both variations had correct type and size again).

Back to $subject, what is still broken since then and should be accepted
portably in C99 (and not only there), is ``short signed int'' -- at least
up until the 2008-09-04 release it triggers a ``invalid type specification''
error and stops compilation.

(This is no criticism or anything; just a note on conformance)

Thanks teapot

It is fixed now.
 
M

Mr. Burns

jacob said:
teapot said:
new said:
[...] In my project I use signed short but in older
lcc-win32 sizeof(signed short) is 2 and after update sizeof(signed
short) is 4 and sizeof(short signed) still 2 but compiler warn "no type
specified. Defaulting to int" and I ask if short signed better or signed
short better.

That bug was corrected only two days after you reported it, in the
version released on July 16th (in that release it still warned on
``short signed''; but both variations had correct type and size again).

Back to $subject, what is still broken since then and should be accepted
portably in C99 (and not only there), is ``short signed int'' -- at least
up until the 2008-09-04 release it triggers a ``invalid type
specification'' error and stops compilation.

(This is no criticism or anything; just a note on conformance)

Thanks teapot

It is fixed now.

Excellent!
 

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

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,200
Latest member
LaraHunley

Latest Threads

Top