Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] CODAN question for function can not be resolved AND invalid arguments!

If you really think it is invalid create this program: two files (No headers).

foo.c:
   foo(int a) {
  }

main.c:
  main(){
     foo("bla");
  }

On Fri, Sep 10, 2010 at 2:15 PM, Figuer, Felipe A <Felipe.A.Figuer@xxxxxxxxxx> wrote:

I agree.

 

At the end it is the same checking.  Checking parameters mismatches.

 

Citing Hatton “EC–A measurement based safer subset of ISO C suitable for embedded system development”

 

4.3.2 F PROT: All function calls and definitions shall be preceded by a new-style function prototype

4.3.3 F COMP: All function call arguments and function definition parameters shall be compatible with the corresponding arguments in the corresponding function declaration

 

Blablabla..

 

“Note that the first of these two rules is redundant in C++ as it is the only facility provided in that language. The second rule is however worthwhile in C++ also.”

 

Regards,

Felipe

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Tomasz Wesolowski
Sent: Friday, September 10, 2010 1:08 PM
To: elaskavaia.cdt@xxxxxxxxx
Cc: CDT General developers list.


Subject: Re: [cdt-dev] CODAN question for function can not be resolved AND invalid arguments!

 

 

2010/9/10 Alena Laskavaia <elaskavaia.cdt@xxxxxxxxx>

2010/9/10 Tomasz Wesołowski <kosashi@xxxxxxxxx>:

> 2010/9/3 Alena Laskavaia <elaskavaia.cdt@xxxxxxxxx>
>>
>> No there is no problem with codan or the parser.
>
> Why would we want the C-parser be inconsistent with C++-parser, i.e. not
> report exactly the same problem which the other parser already reports?

Because C and C++ are two different language. And C is not subset of
C++ as you may think.


Definitely there are numerous differences, but we're not talking about any language difference now - a function call with invalid parameters is invalid in both languages.

Calling an undeclared function (mentioned earlier) is C++-specific error, but calling a function with parameter mismatch is invalid in both. I'm implying that if one parser detects it, the other should, too - for the sake of sheer consistency.

 

****************************************************************************************
 
Note:  If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. 
 
****************************************************************************************

 

****************************************************************************************

Note:  If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. 

****************************************************************************************


Back to the top