-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #8312 - EnergyPlus Build Warnings on gcc >= 9 #8391
Changes from 8 commits
98dbfac
b8783f5
d6a5992
bd11008
cb6c556
d53fb76
2fc152f
61ce567
3f11f1a
2db34ed
d58a263
65489a9
55646d2
f6888ab
b70d5cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -784,6 +784,9 @@ if(BUILD_GROUND_PLOT) | |
endif() | ||
if(UNIX AND NOT APPLE) | ||
target_link_libraries( energypluslib dl ) | ||
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0) | ||
target_link_libraries( energypluslib util ) | ||
endif() | ||
Comment on lines
+797
to
+799
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't link without this on GCC 10. Undefined reference to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
endif() | ||
if (WIN32) | ||
target_link_libraries( energypluslib Shlwapi ) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,31 +6,32 @@ | |
/// | ||
/// | ||
/// \author Thierry Stephane Nouidui, | ||
/// Simulation Research Group, | ||
/// Simulation Research Group, | ||
/// LBNL, | ||
/// [email protected] | ||
/// | ||
/// \date 2011-11-11 | ||
/// | ||
/// This header file defines the energyplus functions | ||
/// This header file defines the energyplus functions | ||
/// that mapped to fmiFunctions and will be exported | ||
/// in .dll | ||
/////////////////////////////////////////////////////// | ||
|
||
#include "FMI/fmiModelFunctions.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Include problem. |
||
#include "fmiModelTypes.h" | ||
#include <stdlib.h> | ||
/* Export fmi functions on Windows */ | ||
#ifdef _MSC_VER | ||
#define DllExport __declspec( dllexport ) | ||
#define DllImport __declspec( dllexport ) | ||
#define DllExport __declspec(dllexport) | ||
#define DllImport __declspec(dllexport) | ||
|
||
#else | ||
#define DllExport | ||
#endif | ||
|
||
/* make sure all compiler use the same alignment policies for structures */ | ||
#ifdef WIN32 | ||
#pragma pack(push,8) | ||
#pragma pack(push, 8) | ||
#endif | ||
|
||
/* Version number */ | ||
|
@@ -46,48 +47,46 @@ | |
EnergyPlus Functions for FMI for Co-Simulation | ||
|
||
****************************************************/ | ||
DllExport fmiComponent fmiEPlusInstantiateSlave(char* fmuResFolder, | ||
fmiInteger *sizefmuResFolder, fmiReal *timeOut, fmiInteger *visible, | ||
fmiInteger *interactive, fmiInteger *loggingOn, fmiInteger *index); | ||
DllExport fmiComponent fmiEPlusInstantiateSlave(char *fmuResFolder, | ||
fmiInteger *sizefmuResFolder, | ||
fmiReal *timeOut, | ||
fmiInteger *visible, | ||
fmiInteger *interactive, | ||
fmiInteger *loggingOn, | ||
fmiInteger *index); | ||
Comment on lines
+51
to
+56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Plenty of changes are due to the fact that I clang-formatted all the files in the FMI and FMUParser folders, as they were pretty messy. |
||
|
||
DllExport fmiStatus fmiEPlusInitializeSlave(fmiComponent *fmuInstance, | ||
fmiReal *tStart, fmiInteger *newStep, fmiReal *tStop, fmiInteger *index); | ||
DllExport fmiStatus fmiEPlusInitializeSlave(fmiComponent *fmuInstance, fmiReal *tStart, fmiInteger *newStep, fmiReal *tStop, fmiInteger *index); | ||
|
||
DllExport fmiStatus fmiEPlusGetReal(fmiComponent *fmuInstance, const fmiValueReference valRef [], | ||
fmiReal outValue[], fmiInteger *numOutputs, fmiInteger *index); | ||
DllExport fmiStatus | ||
fmiEPlusGetReal(fmiComponent *fmuInstance, const fmiValueReference valRef[], fmiReal outValue[], fmiInteger *numOutputs, fmiInteger *index); | ||
|
||
DllExport fmiStatus fmiEPlusSetReal(fmiComponent *fmuInstance, const fmiValueReference valRef[], | ||
fmiReal inpVal[], fmiInteger *numInputs, fmiInteger *index); | ||
DllExport fmiStatus | ||
fmiEPlusSetReal(fmiComponent *fmuInstance, const fmiValueReference valRef[], fmiReal inpVal[], fmiInteger *numInputs, fmiInteger *index); | ||
|
||
DllExport fmiStatus fmiEPlusDoStep(fmiComponent *fmuInstance, fmiReal *curCommPoint, | ||
fmiReal *commStepSize, fmiInteger *newStep, fmiInteger *index); | ||
DllExport fmiStatus fmiEPlusDoStep(fmiComponent *fmuInstance, fmiReal *curCommPoint, fmiReal *commStepSize, fmiInteger *newStep, fmiInteger *index); | ||
|
||
DllExport fmiStatus fmiEPlusFreeSlave(fmiComponent *fmuInstance, fmiInteger *index, fmiInteger *fmiEndSimulation); | ||
|
||
fmiStatus fmiEPlusResetSlave(fmiComponent *fmuInstance, fmiInteger *index); | ||
fmiStatus fmiEPlusResetSlave(fmiComponent *fmuInstance, fmiInteger *index); | ||
|
||
DllExport fmiInteger fmiEPlusUnpack(char* fmuName, char* fmuOutputWorkingFolder, | ||
fmiInteger *sizefmuName, fmiInteger *sizefmuOutputWorkingFolder); | ||
DllExport fmiInteger fmiEPlusUnpack(char *fmuName, char *fmuOutputWorkingFolder, fmiInteger *sizefmuName, fmiInteger *sizefmuOutputWorkingFolder); | ||
|
||
DllExport fmiInteger addLibPathCurrentWorkingFolder(char* trimfmuOutputWorkingFolder_wLiB, | ||
char* fmuWorkingFolder, fmiInteger *sizefmuWorkingFolder, fmiInteger *index); | ||
DllExport fmiInteger addLibPathCurrentWorkingFolder(char *trimfmuOutputWorkingFolder_wLiB, | ||
char *fmuWorkingFolder, | ||
fmiInteger *sizefmuWorkingFolder, | ||
fmiInteger *index); | ||
|
||
DllExport fmiValueReference getValueReferenceByNameFMUInputVariables(char* variableName, | ||
fmiInteger *sizeVariableName, fmiInteger *index); | ||
DllExport fmiValueReference getValueReferenceByNameFMUInputVariables(char *variableName, fmiInteger *sizeVariableName, fmiInteger *index); | ||
|
||
DllExport fmiValueReference getValueReferenceByNameFMUOutputVariables(char* variableName, | ||
fmiInteger *sizeVariableName, fmiInteger *index); | ||
DllExport fmiValueReference getValueReferenceByNameFMUOutputVariables(char *variableName, fmiInteger *sizeVariableName, fmiInteger *index); | ||
|
||
DllExport fmiInteger model_ID_GUID(char* fmuInstanceName, char* fmuWorkingFolder, | ||
fmiInteger *sizefmuWorkingFolder, fmiInteger *numInputs, | ||
fmiInteger *numOutputs); | ||
DllExport fmiInteger | ||
model_ID_GUID(char *fmuInstanceName, char *fmuWorkingFolder, fmiInteger *sizefmuWorkingFolder, fmiInteger *numInputs, fmiInteger *numOutputs); | ||
|
||
DllExport fmiInteger addFMURootFolderName(char* fmuOutputWorkingFolder, | ||
char* fmuWorkingFolder, fmiInteger *sizefmuWorkingFolder); | ||
DllExport fmiInteger addFMURootFolderName(char *fmuOutputWorkingFolder, char *fmuWorkingFolder, fmiInteger *sizefmuWorkingFolder); | ||
|
||
DllExport fmiInteger getfmiEPlusVersion(char* fmuWorkingFolder, | ||
fmiInteger *sizefmuWorkingFolder, char *fmiVersionNumber, fmiInteger *index); | ||
DllExport fmiInteger getfmiEPlusVersion(char *fmuWorkingFolder, fmiInteger *sizefmuWorkingFolder, char *fmiVersionNumber, fmiInteger *index); | ||
|
||
DllExport fmiInteger checkOperatingSystem(char* errorMessage); | ||
DllExport fmiInteger checkOperatingSystem(char *errorMessage); | ||
|
||
#endif // eplusModelFunctions_h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious to see if clang will throw or not. We can remove this line if it's problematic, but it worked on GCC and we might as well turn it on to avoid having warnings sneak into the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Myoldmopar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Enabling /W4 or /Wall on windows would be interesting too)
EnergyPlus/cmake/CompilerFlags.cmake
Line 28 in f586325