Atmel AS7 ARM C Preprocessor directives missing #error?

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

Hi all,

 

Does AS7 using ARM support the #error and #message preprocessor directives?  I was trying to add in #error to abort compiling if it detects a certain condition.  It looks like the #warning works but not #error.  Is there something similar?

 

Thanks.

 

This topic has a solution.
Last Edited: Thu. Jan 18, 2018 - 01:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nevermind; I guess it does. 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tarribred wrote:
AS7 using ARM

That would be GCC.

 

Yes, GCC certainly does support #error.

 

Note that #error is specified by the language standard; others are extensions

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks.  My problem was actually that I was testing the value of an enumeration that is implicitely assigned a value so the preprocessor didn't do the test the way I expected. After scratching my head and then posting the question I realized what was going on.

 

 

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

So you can now mark the solution - instructions here: https://www.avrfreaks.net/comment...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...