Skip to content

Commit

Permalink
Merge pull request #8522 from NREL/gcc10_error
Browse files Browse the repository at this point in the history
Fix build error on gcc10, which has `Default to -fno-common`
  • Loading branch information
Myoldmopar authored Feb 10, 2021
2 parents d6d98fa + 6d7a2e7 commit 687fc39
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 18 deletions.
29 changes: 29 additions & 0 deletions third_party/BCVTB/utilXml.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,32 @@ derivative works thereof, in binary and source code form.

#include "utilXml.h"



Stack2 expStk; ///< Variables for getxmlvalue function

char * att; ///< Local global variable for function \c getxmlvalue
char * vals; ///< Local global variable for function \c getxmlvalue
size_t * numVals; ///< Local global variable for function \c getxmlvalue
int PARSEVALUE; ///< flag for parsing xml values 1 if parse, 0 if not parse
int ERROR_STATUS; ///< flag for xml element handler error status settings

////////////////////////////////////////////////////////////////
/// local global variables for function \c getepvariables
////////////////////////////////////////////////////////////////
char * outputVarsName; ///< the string pointer to the parsed output variable names
char * outputVarsType; ///< the string pointer to the parsed output variable types
int * numOutputVars; ///< the integer pointer to the number of output variables
char * inputVars; ///< the string pointer to the input variables
int * numInputVars; ///< the integer pointer to the number of input variables
int * inputVarsType; ///< the integer array to store the types of each input variables
char ** inputKeys; ///< the string array to store the types of input variable types
int numInputKeys; ///< the number of input variable types
int source; ///< flag for function /c getepvariables 0=EnergyPlus, 1=Ptolemy
size_t const * strLen; ///< the length of string parsed to this function



////////////////////////////////////////////////////////////////
/// Call back functions that will be used by the expat xml parser.
///
Expand Down Expand Up @@ -257,6 +283,7 @@ getepvariables(
)
{

char Buff[BUFFSIZE]; ///< Local buffer for reading in the xml file
FILE * fd;
XML_Parser p;
int i, j, count, ret;
Expand Down Expand Up @@ -398,6 +425,7 @@ getepvariablesFMU(
)
{

char Buff[BUFFSIZE]; ///< Local buffer for reading in the xml file
FILE * fd;
XML_Parser p;
int i, j, count;
Expand Down Expand Up @@ -622,6 +650,7 @@ getxmlvalues(
size_t const myStrLen
)
{
char Buff[BUFFSIZE]; ///< Local buffer for reading in the xml file
char * temp;
int i,j;
FILE * fd;
Expand Down
39 changes: 21 additions & 18 deletions third_party/BCVTB/utilXml.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ derivative works thereof, in binary and source code form.
********************************************************************
*/

#ifndef utilXml_h_INCLUDED
#define utilXml_h_INCLUDED

///////////////////////////////////////////////////////////
/// \file utilXml.h
/// \brief Methods for getting xml values
Expand Down Expand Up @@ -124,8 +127,6 @@ derivative works thereof, in binary and source code form.

#define BUFFSIZE 8192

char Buff[BUFFSIZE]; ///< Local buffer for reading in the xml file

////////////////////////////////////////////////////////////////
///\struct A simple stack structure to keep track of the parent elements
////////////////////////////////////////////////////////////////
Expand All @@ -136,27 +137,27 @@ typedef struct Stack2 {
} Stack2;


Stack2 expStk; ///< Variables for getxmlvalue function
extern Stack2 expStk; ///< Variables for getxmlvalue function

char * att; ///< Local global variable for function \c getxmlvalue
char * vals; ///< Local global variable for function \c getxmlvalue
size_t * numVals; ///< Local global variable for function \c getxmlvalue
int PARSEVALUE; ///< flag for parsing xml values 1 if parse, 0 if not parse
int ERROR_STATUS; ///< flag for xml element handler error status settings
extern char * att; ///< Local global variable for function \c getxmlvalue
extern char * vals; ///< Local global variable for function \c getxmlvalue
extern size_t * numVals; ///< Local global variable for function \c getxmlvalue
extern int PARSEVALUE; ///< flag for parsing xml values 1 if parse, 0 if not parse
extern int ERROR_STATUS; ///< flag for xml element handler error status settings

////////////////////////////////////////////////////////////////
/// local global variables for function \c getepvariables
////////////////////////////////////////////////////////////////
char * outputVarsName; ///< the string pointer to the parsed output variable names
char * outputVarsType; ///< the string pointer to the parsed output variable types
int * numOutputVars; ///< the integer pointer to the number of output variables
char * inputVars; ///< the string pointer to the input variables
int * numInputVars; ///< the integer pointer to the number of input variables
int * inputVarsType; ///< the integer array to store the types of each input variables
char ** inputKeys; ///< the string array to store the types of input variable types
int numInputKeys; ///< the number of input variable types
int source; ///< flag for function /c getepvariables 0=EnergyPlus, 1=Ptolemy
size_t const * strLen; ///< the length of string parsed to this function
extern char * outputVarsName; ///< the string pointer to the parsed output variable names
extern char * outputVarsType; ///< the string pointer to the parsed output variable types
extern int * numOutputVars; ///< the integer pointer to the number of output variables
extern char * inputVars; ///< the string pointer to the input variables
extern int * numInputVars; ///< the integer pointer to the number of input variables
extern int * inputVarsType; ///< the integer array to store the types of each input variables
extern char ** inputKeys; ///< the string array to store the types of input variable types
extern int numInputKeys; ///< the number of input variable types
extern int source; ///< flag for function /c getepvariables 0=EnergyPlus, 1=Ptolemy
extern size_t const * strLen; ///< the length of string parsed to this function


////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -369,3 +370,5 @@ getxmlvalue(
////////////////////////////////////////////////////////////////
int
check_variable_cfg_Validate(char const * const fileName);

#endif // utilXml_h_INCLUDED

4 comments on commit 687fc39

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2299 of 2299 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-MacOS-10.15-clang-11.0.0: OK (2279 of 2279 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1560 of 1560 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (722 of 722 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.