AVR GCC preprocessor messages?

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Greetings -

 

I have been using #warning statements for general information (to me) about things like whether a given feature is on. But, I see in the AS7 IDE Error and Output pane, that there is also a tab for Messages. I have tried various things like #message "my message string" in preference to #warning, which these things really are not, but that just generates 

 

invalid preprocessing directive #message

I can find nothing in the gcc preprocessor documentation about anything related to messages. 

 

Do I just forget about this, or is there a way to display messages of lower severity than #warning ?

 

Thanks

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

#pragma message "your message"

 

https://gcc.gnu.org/onlinedocs/g...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And another option is

#define MESSAGE(text) MESSAGE_PRAGMA(message #text)
#define MESSAGE_PRAGMA(text) _Pragma(#text)

MESSAGE("show a message")

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmm -

 

Not much satisfaction!

 

I tried this:

 

#ifdef FILE_OPENCLOSE
#pragma message "FILE OPEN & CLOSE mode in file_functs.h"
#else
#pragma message "FILE ALWAYS OPEN mode in file_functs.h"
#endif

In a header file file_functs.h that is widely included in the project, and I get no output, at all. There is nothing in the Messages tab and nothing in the Warnings tab. Do I need to do anything else? No compiler errors, either! Nothing found in AS7 Help.

 

Thanks

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Thu. Apr 18, 2019 - 04:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Never mind, it works. I forgot to save the file with that change!

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net