need help

B

Ben Bacarisse

Bartc said:
Hans Schneider wrote:

I think until recently lccwin didn't allow type specifiers in any order,
even though the C standard rather unwisely didn't prohibit this.

There was a problem (now reported as fixed) that involved the new C99
type "long long" but that version, quite correctly, accepts "signed
int short". I am skeptical about the claim, simply because lcc-win32
is based on a well-respected C parser from lcc. I suppose that it is
possible that there is an even older version of lcc-win32 that did
reject the declaration but I doubt it. I think the OP is being
provocative.
Presumably
for historic reasons.

I can't think of any historical reason to reject that syntax and, as I
have said, I would be surprised if (plain) lcc rejected it.
Now lccwin seems to go along with other C compilers rather than take a
stand. So you can now write every declaration in at least N!
different ways.

I think it would have been very unwise to have done anything else. Of
course, a flag "-Wodd-type-specifier-order" might be useful.
 
J

Joachim Schmitz

Richard said:
kevin said:

On my computer at home 'D' is 68 and 'Q' is 81, no problem there.

On my computer at school, 'D' is 196, 'Q' is 216, and 'D' + 13 is
209, which is 'J'. Problem.

What to do?

It's called programming.

#define LIM 13

char lookup[UCHAR_MAX + 1] = {0};
char lower[] = "abcdefghijklmnopqrstuvwxyz";
char upper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int i;
int ch;
assert(UCHAR_MAX < INT_MAX);
for(i = 0; i <= UCHAR_MAX; i++)
{
lookup = i;
}
for(i = 0; i < LIM; i++)


Why using LIM here...
{
lookup[lower] = lower[i + 13];
lookup[lower[i + 13]] = lower;
lookup[upper] = upper[i + 13];
lookup[upper[i + 13]] = upper;


.... but not here?

Bye, Jojo
 
J

Joachim Schmitz

Richard said:
Joachim Schmitz said:
Richard Heathfield wrote:
}
for(i = 0; i < LIM; i++)

Why using LIM here...
{
lookup[lower] = lower[i + 13];
lookup[lower[i + 13]] = lower;
lookup[upper] = upper[i + 13];
lookup[upper[i + 13]] = upper;


... but not here?


Sloppiness, my dear fellow - pure sloppiness.

I thought so, but also suspected some deep secret hiding here :cool:

Bye, Jojo
 

Ask a Question

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

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top