View previous topic :: View next topic |
Author |
Message |
seme Guest
|
Generating Compiler Messages |
Posted: Thu Aug 02, 2007 1:50 am |
|
|
Hello,
Just like with the messg directive in MPASM I need to generate
warnings with CCS-C. Those warnings should be printed to the
screen for a feedback to the user. For example "Warning:
Debug Mode enabled".
The #error directive causes the compiler to abort, in an #asm
block messg is not recognized, printf only works for RS232.
Is there any possibility to make the compiler print a warning
message to the screen?
Thanks a lot for your input!
Cheers,
seme |
|
|
Guest
|
|
Posted: Thu Feb 12, 2009 6:59 am |
|
|
Hi
Try the pre-processor directive
Code: | #error/warning Text |
cheers Simon |
|
|
portscanner
Joined: 23 Nov 2009 Posts: 3
|
Cant get #warning to generate a warning |
Posted: Sat Jan 02, 2010 8:52 am |
|
|
here is my test code:
Code: |
#include <18F87J60.h>
#fuses NOWDT,STVREN,XINST,NOPROTECT,H4_SW,FCMEN,IESO,WDT32768,ETHLED
#use delay(clock=25000000,external)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,enable=PIN_C0)
#IGNORE_WARNINGS NONE
#WARNING will robinson
void main()
{
}
|
When compiled with the command:
ccsc +FH x.C
I get:
Code: |
CCS PCH C Compiler
Registered to: portscanner ,
in /home/portscanner/development/
Compiling: x.C
Linking
Writing x.hex
Writing x.sym
Writing x.lst
Writing x.cod
Writing x.pjt
Memory usage:
ROM=0%
RAM=0% - 0%
Files: 2, Statements: 0, Time: 1 Sec, Lines: 461
0 Errors, 0 Warnings, Time: 1 Seconds
No Errors /home/delingch/development/DigilightII/2.03a/x.PJT
0 Errors, 0 Warnings.
|
I am running PCH compiler version 4.101;7/1/2009 on Linux
Any suggestions? |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Sat Jan 02, 2010 1:15 pm |
|
|
I use #warning in code all the time with the windows compiler.
I've never used the #ignore_warnings though. Try turning that off just to see.
If it works then, you have maybe a bug..
I don't have the Linux Compiler to check againsts.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
portscanner
Joined: 23 Nov 2009 Posts: 3
|
|
Posted: Sat Jan 02, 2010 2:01 pm |
|
|
There is no difference with or without the #ignore_warnings
Looks like a bug in the Linux version |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jan 03, 2010 1:11 pm |
|
|
#warning has never worked in the command-line compilers.
It doesn't display anything in the Output Window in MPLAB.
I emailed CCS about this back in October 2008, for vs. 4.081.
(It still doesn't work in vs. 4.104).
They responded with an ID number for the bug, but never did
anything about it. I sent them a new email just now to remind
them about it. |
|
|
|