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!

Hi,

I think char to double is legal (at least it compiles for me). There could be another checker for "dangerous conversions". About function_that_does_not, I think it has to do with the fact that you are using C and you don't need a prototype. I could also be another checker. If you try this in C++ it should report an error for function_that_does_not.

Marc-Andre

On 02/09/2010 7:03 PM, Figuer, Felipe A wrote:

Hi all.  First thanks for your help.

 

Do the “function can not be resolved” and the “invalid arguments”  checkers work?

 

I am trying them in a trivial project having the inclusion for both as: src/*.c

 

The code is quite trivial:

 

Sample.h contents:

 

#ifndef SAMPLE_H_

#define SAMPLE_H_

 

int h_function(double param);

void void_func();

#endif /* SAMPLE_H_ */

Sample.c contents:

 

#include <stdlib.h>

#include "Sample.h"

 

int main(void) {

      return EXIT_SUCCESS + h_function('a') + function_that_does_not();

}

int h_function(double param) {

      return 45;

}

 

void void_func() {

      return;

}

 

I was expecting a warning or something similar for the h_function call (it provides a char when a double is declared as the type parameter).

 

On the other hand as the case of referring an undeclared variable I was expecting a warning or something  like that for the not declared function call function_that_does_not.

 

Am I missing something?

 

Best regards and thanks again,

 

Felipe Antonio Martinez Figueroa.

+52 442 1030500 Ext.1249.

felipe.a.figuer@xxxxxxxxxx

Delphi Electronics & Safety

Software Development Tools & Expert Synergy User & Suggestions Committee Leader

Queretaro Technical Center.

Circuito Palma Cocotera No. 2059.

Fraccionamiento Palmares.

Queretaro, Qro. CP 76127

Mexico.

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

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. 

****************************************************************************************
_______________________________________________ cdt-dev mailing list cdt-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top