Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Pro*C cope with #warning directives?

When I try to precompile a *.pc file that contains a #warning directive I recieve the following error:

PCC-S-02014, Encountered the symbol "warning" when expecting one of the following: (bla bla bla).

Can I somehow convince Pro*C to ignore the thing if it doesn't know what to do with it? I can't remove the #warning directive as it's used in a header file that I can't change and must include.

like image 638
Maximilian Avatar asked Oct 29 '25 05:10

Maximilian


1 Answers

According to the Pro*C/C++ Programmer's Guide (chapter 5 "Advanced Topics"), Pro*C silently ignores a number of preprocessor directives including #error and #pragma, but sadly not #warning. Since your warning directives are included in a header file, you might be able to use the ORA_PROC macro:

#ifndef  ORA_PROC
#include <irrelevant.h>
#endif

For some reason, Pro*C errors out if you try to hide a straight #warning that way, however.

like image 143
Jon Ericson Avatar answered Oct 31 '25 20:10

Jon Ericson