Ignore warnings via #pragma

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
luator
Junior Member
Posts: 5
Joined: Mon Mar 18, 2019 2:54 pm

Ignore warnings via #pragma

Post by luator »

Hi all,

is there a way to ignore warnings via pragmas in xC?

I want to disable warnings for external headers. With GCC, for example, this seems to be possible with pragmas like this:

Code: Select all

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include </path/to/real/include.h>
#pragma GCC diagnostic pop
(Source: https://stackoverflow.com/a/46946857/2095383)

Is there a way to achieve the same with XCC? (Just replacing GCC with XCC does not work)


User avatar
akp
XCore Expert
Posts: 578
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

If you can live with doing this for full .xc or .c files then you can add it to the Makefile

Code: Select all

XCC_FLAGS = <whatever>
XCC_FLAGS_<filename>.xc = $(XCC_FLAGS) -Wunused-parameter
Post Reply