[bug] Very annoying compilation warnings


I'm using OCC 6.2 installed on KUbuntu 7.10. When compiling some of my programs with gcc (4.1.3) I always get plenty of annoying compilation warnings of the form "warning: deprecated conversion from string constant to ‘char*’".

In header gp_Dir.lxx there are at least a tenth of those warnings, the first one is at line 18 :

Standard_ConstructionError_Raise_if (D

It seems that all those warnings are caused by the way the exception mechanism is implemented. When defining the macro "No_Exception" then most of those warnings are hidden but some reside and persist ! Particularly a deprecation warning in TCollection_AsciiString.lxx at lign 112.

I tried to quickly tweak the source code but with no success. How could those warnings be removed ?

m-aronsson's picture

If you only want to get rid of the warnings, why not just disable the warnings, then you don't have to mess with the source code.

PG's picture


How to disable the warnings .. is there any flag ?

- gpr

Hugues Delorme's picture

In general I don't like to disable warnings, however I would do so in this case. But I can't find how to disable a specific warning with g++ (4.1.3). I'll try something like -Wno-deprecated but all deprecation warnings will be mute.

Hugues Delorme's picture


Using gcc 4.2.3 I still have the same problem : bunch of the deprecation warnings in OpenCascade headers. I tried -Wno-deprecated but with no effect.
Do guys working with gcc and OpenCascade have the problem ?

How to disable this deprecation warning with gcc ? Can't find how to do so.