CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Generating Compiler Messages

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
seme
Guest







Generating Compiler Messages
PostPosted: Thu Aug 02, 2007 1:50 am     Reply with quote

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








PostPosted: Thu Feb 12, 2009 6:59 am     Reply with quote

Hi

Try the pre-processor directive

Code:
 #error/warning  Text



cheers Simon
portscanner



Joined: 23 Nov 2009
Posts: 3

View user's profile Send private message

Cant get #warning to generate a warning
PostPosted: Sat Jan 02, 2010 8:52 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Jan 02, 2010 1:15 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Jan 02, 2010 2:01 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jan 03, 2010 1:11 pm     Reply with quote

#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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group