Supressing Warning Messages in HiTech C for PSoC

HiTech had a great compiler for PSoC's M8C processor, but, then they were bought by Microchip. Subsequently the HiTech forums were taken off line. At the request of PSoCDeveloper members PSoCDeveloper has created this forum to allow HiTech users to support each other.

Moderator: ericb

Supressing Warning Messages in HiTech C for PSoC

Postby baxsie » Tue Jun 02, 2009 4:01 pm

This is something I learned, then forgot, then found again, so I thought I would put it here so it can be found.

If you have a compiler warning that you want to silence locally in Hi Tech C for PSoC, but not turn it off globally, you can use this syntax:

Code: Select all
#pragma warning(push)
#pragma warning(disable:340)

//16-character fixed length array, no terminator needed
static const unsigned char
  //           0123456789012345
  Version[16]="unterminated str";

#pragma warning(pop)
baxsie
The Big Cheese
The Big Cheese
 
Posts: 420
Joined: Mon Dec 22, 2003 10:08 pm

Return to “%s” HiTech C User-to-User Support

Who is online

Users browsing this forum: No registered users and 1 guest