Skip to content

Commit

Permalink
Fix C4068
Browse files Browse the repository at this point in the history
```
warning C4068: unknown pragma
```
  • Loading branch information
fjeremic committed Jun 4, 2021
1 parent 848cf1a commit 5ee725f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion compiler/codegen/OMRCodeGenPhase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/

#if defined(J9ZOS390)
//On zOS XLC linker can't handle files with same name at link time
//This workaround with pragma is needed. What this does is essentially
//give a different name to the codesection (csect) for this file. So it
Expand All @@ -27,7 +28,7 @@
#pragma csect(CODE,"OMRCGPhase#C")
#pragma csect(STATIC,"OMRCGPhase#S")
#pragma csect(TEST,"OMRCGPhase#T")

#endif

#include "codegen/CodeGenPhase.hpp"

Expand Down
2 changes: 2 additions & 0 deletions compiler/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/

#if defined(J9ZOS390)
#pragma csect(CODE,"TRCGBase#C")
#pragma csect(STATIC,"TRCGBase#S")
#pragma csect(TEST,"TRCGBase#T")
#endif

#include "codegen/CodeGenerator.hpp"

Expand Down
3 changes: 2 additions & 1 deletion compiler/codegen/OMRMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/

#if defined(J9ZOS390)
//On zOS XLC linker can't handle files with same name at link time
//This workaround with pragma is needed. What this does is essentially
//give a different name to the codesection (csect) for this file. So it
Expand All @@ -27,7 +28,7 @@
#pragma csect(CODE,"OMRMachine#C")
#pragma csect(STATIC,"OMRMachine#S")
#pragma csect(TEST,"OMRMachine#T")

#endif

#include "codegen/Machine.hpp"

Expand Down
9 changes: 9 additions & 0 deletions compiler/env/FEBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@ char *feGetEnv(const char *s)
#include "control/Options.hpp"
#include "control/Options_inlines.hpp"

#if defined(LINUX)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
#elif defined(OSX)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#endif

TR::OptionTable OMR::Options::_feOptions[] =
{
Expand All @@ -116,7 +121,11 @@ TR::OptionTable OMR::Options::_feOptions[] =
{0}
};

#if defined(LINUX)
#pragma GCC diagnostic pop
#elif defined(OSX)
#pragma clang diagnostic pop
#endif

#include "control/Recompilation.hpp"

Expand Down
2 changes: 2 additions & 0 deletions compiler/env/OMRCPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/

#if defined(J9ZOS390)
#pragma csect(CODE,"OMRCPUBase#C")
#pragma csect(STATIC,"OMRCPUBase#S")
#pragma csect(TEST,"OMRCPUBase#T")
#endif

#include "env/CPU.hpp"
#include "env/CompilerEnv.hpp"
Expand Down

0 comments on commit 5ee725f

Please sign in to comment.