Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers LCC > Re: lcc and c99...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 16 of 21 Topic 977 of 1070
Post > Topic >>

Re: lcc and c99 conformance

by "Antoine Leca" <root@[EMAIL PROTECTED] > Oct 15, 2007 at 05:38 PM

En news:87myul9uok.fsf@[EMAIL PROTECTED]
 Ben Bacarisse va escriure:
> jacob navia writes:
>
>> Ben Bacarisse wrote:
>>>
>>> ---------------- 1
>>> int f(int *i) { return *i; }
>>>
>>> void t(void)
>>> {
>>>      long l = 0;
>>>      f(&l);
>>> }


lcc (4.1) chokes on this one:
    6: type error in argument 1 to `f'; found `pointer to long int'
     expected `pointer to int'


In view of the following discussion, I'd append it does it without the -A
option.


>> This provokes a warning if the -A option is present.
>> Otherwise it doesn't.
>
> I thought -ansic was the flag to request standards mode.  What is
> "-A"?

This is standard lcc option to be given more diagnostics.
The manual says:

-A   Warns about declarations and casts of function types without
     prototypes, assignments between pointers to ints and pointers to
     enums, and conversions from pointers to smaller integral types.
     A second -A warns about unrecognized control lines, nonANSI
     language extensions and source characters in literals,
     unreferenced variables and static functions, declaring arrays of
     incomplete types, and exceeding /some/ ANSI environmental limits,
     like more than 257 cases in switches. It also arranges for
     duplicate global definitions in separately compiled files to cause
     loader errors.


> MSVC doesn't warn either by default.

This is one that makes me nervious. Are you considering lcc-win32 should
follow MSVC's behaviour rather that sticks with what was/is in standard
lcc?


Furthermore, I got (-W1 selects minimal warnings)

C> path\to\VS2005\cl.exe -Za -W1 -c 1.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.40904 for
80x86
Copyright (C) Microsoft Cor****ation.  All rights reserved.

1.c
1.c(6) : warning C4133: 'function' : incompatible types - from 'long *' to
'int *'


And this hardly new: I also have
C> path\to\VC++5\cl.exe -Za -W1 -c 1.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 11.00.7022 for
80x86
Copyright (C) Microsoft Corp 1984-1997. All rights reserved.

1.c
1.c(6) : warning C4133: 'function' : incompatible types - from 'long *' to
'int *'


You are correct that the Microsoft compiler does not choke in
"compatibility" mode (-Ze), but then I shall argue this mode was made to
allow the quietest compilations of earlier softwares, back around 1989.

Or have you changed the -A option to really means the same as -Za?
(This is exactly what did Borland, by the way.)


Antoine
 




 21 Posts in Topic:
lcc and c99 conformance
"Wade Ward" <  2007-09-10 04:24:34 
Re: lcc and c99 conformance
"Antoine Leca"   2007-09-12 14:43:51 
Re: lcc and c99 conformance
jacob navia <jacob@[EM  2007-09-12 15:06:48 
Re: lcc and c99 conformance
"Antoine Leca"   2007-09-12 19:13:44 
Re: lcc and c99 conformance
"Wade Ward" <  2007-09-12 17:11:38 
Re: lcc and c99 conformance
jacob navia <jacob@[EM  2007-09-12 15:05:22 
Re: lcc and c99 conformance
"Wade Ward" <  2007-09-12 17:22:09 
Re: lcc and c99 conformance
Ben Bacarisse <ben.use  2007-10-14 19:03:20 
Re: lcc and c99 conformance
jacob navia <jacob@[EM  2007-10-14 20:21:16 
Re: lcc and c99 conformance
CBFalconer <cbfalconer  2007-10-14 20:45:58 
Re: lcc and c99 conformance
jacob navia <jacob@[EM  2007-10-14 20:45:49 
Re: lcc and c99 conformance
"Charlie Gordon"  2007-10-15 13:14:47 
Re: lcc and c99 conformance
Ben Bacarisse <ben.use  2007-10-14 23:15:08 
Re: lcc and c99 conformance
"Antoine Leca"   2007-10-15 17:51:03 
Re: lcc and c99 conformance
Ben Bacarisse <ben.use  2007-10-14 23:51:23 
Re: lcc and c99 conformance
"Antoine Leca"   2007-10-15 17:38:29 
Re: lcc and c99 conformance
jacob navia <jacob@[EM  2007-10-15 18:03:07 
Re: lcc and c99 conformance
Ben Bacarisse <ben.use  2007-10-15 12:43:44 
Re: lcc and c99 conformance
"Charlie Gordon"  2007-10-15 17:17:43 
Re: lcc and c99 conformance
Ben Bacarisse <ben.use  2007-10-15 18:31:06 
Re: lcc and c99 conformance
Ben Bacarisse <ben.use  2007-10-15 18:44:57 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 23:24:01 CDT 2008.