Hi,
I am using CW for MCU 10.6 with HCS08.
If I define an extern variable but it is not actually declared anywhere (or if I set it to 'static' and try to access it from a different module using an 'extern' declaration) the linker will generate the warning L1823 and will automatically create the object locally.
I do not want this behaviour, instead I want a linker error to be generated as expected.
Is it possible to disable this 'feature' in the linker? I have looked through the options and searched through these forums, but have found no solution.
Thanks,
Rosario
已解决! 转到解答。
Hi Rosario,
you can map that warning message to an error with the following linker option:
-WmsgSe1823
That way it does not create such an automatic object.
I hipe this helps,
Erich
hi Rosario,
there are two methods to disable warnings:
(1). add option-WmsgSd<number> to Linker setting.<number>: Message number to be disabled, e.g., 1801
(2). use #pragma OPTION ADD "-WmsgSd1823"
in C code. for more information about #pragma OPTION usage, please see CW help manual.
Hope this helps!
Best Regards,
Zhang Jun
=========================================
this answer is for you. if it helps, please click on "Correct Answer" button. Thanks!
Hi Jennie,
That pragma cannot be used to supress messages, to do that you use #pragma MESSAGE DISABLE
But I *Do Not* want to hide the message, I want to *Stop Automatic Object Creation*. I have looked through the manuals and it seems that this is not possible.
Regards,
Rosario