Warning C1801: Implicit parameter-declaration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Warning C1801: Implicit parameter-declaration

Jump to solution
8,580 Views
BasePointer
Contributor II
Hi,
 
I'm using CW6.0 and HCS08 C.
The compiler generates warnings for my application "Warning C1801: Implicit parameter-declaration".
And this warning causes my application not to work properly.
 
I want to take compile error with this warning. Is this possible?
 
Thanks.
 
 
Labels (1)
Tags (1)
0 Kudos
1 Solution
2,253 Views
BlackNight
NXP Employee
NXP Employee
Hi,
yes, there is a #pragma way for this

something like
#pragma MESSAGE ERROR C1801
(see manual/help files for details).

The other way is to use the
#pragma OPTION ADD xx "-Wpd"
way.

BK

View solution in original post

0 Kudos
7 Replies
2,253 Views
BasePointer
Contributor II
Hi,
 
Standard Settings... -> Compile for HC08 -> Messages -> Warning Tab and I moved C1801 to the Error.
 
Now I'm taking compile error with C1801. This is exactly what I want.
 
Thank you.
BP.
0 Kudos
2,253 Views
BlackNight
NXP Employee
NXP Employee
Hello,
there is as well the compiler option
-Wpd          Error for implicit parameter declaration
under the MESSAGE tab which will flag implicit parameter declarations as error.

BK
0 Kudos
2,253 Views
BasePointer
Contributor II
Hi,
 
 I also wonder if I can do this with #pragma directions?
 
Thanks.
0 Kudos
2,254 Views
BlackNight
NXP Employee
NXP Employee
Hi,
yes, there is a #pragma way for this

something like
#pragma MESSAGE ERROR C1801
(see manual/help files for details).

The other way is to use the
#pragma OPTION ADD xx "-Wpd"
way.

BK
0 Kudos
2,253 Views
BasePointer
Contributor II
That works:
#pragma MESSAGE ERROR C1801     // Implicit parameter declaration
 
Thank you so much.
0 Kudos
2,253 Views
Alban
Senior Contributor II
Hello,

It is possibke to compile without warnings.
The fault is not because of the warning, but probably because you use a function in your code and you did not declare the function prototype before.

Warning and Error codes are very useful as they are described in the help of CodeWarrior.

C1801 means Compiler error. Lxxxx would mean a linker error...

Alban.
0 Kudos
2,253 Views
BasePointer
Contributor II
Hi Alban,
 
My project is huge and as you said I sometimes forget adding functions prototypes.
I can compile entire project successfully even if I did so.
I want compile process to fail if this warning exists for any modules of the project.
 
Or can I see all warings of modules in a list?
I can easly search C1801 in this list.
 
Regards,
BP.
0 Kudos