Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 103b435

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Check for undeclared functions
Belonging to [master]: - #2116 - OpenModelica/OpenModelica-testsuite#829
1 parent 620b30d commit 103b435

File tree

6 files changed

+22
-7
lines changed

6 files changed

+22
-7
lines changed

Compiler/boot/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
CC=@CC@
66
CXX=@CXX@
7-
CFLAGS=@CFLAGS@
7+
CFLAGS=@CFLAGS@ @CHECK_C_ERRORS@
88
TOP_DIR=@abs_top_builddir@
99
OMHOME=@OMBUILDDIR@
1010
OMBUILDDIR=@OMBUILDDIR@

Compiler/runtime/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ GRAPHINCLUDE=../../3rdParty/metis-5.1.0/include
1212
GRAPHSTREAMINCLUDE = ../../3rdParty/graphstream/gs-netstream/c++/src/
1313
CJSONINCLUDE = ../../3rdParty/cJSON
1414
ZMQINCLUDE = ../../3rdParty/libzmq/include
15-
CFLAGS = @CFLAGS@ $(USE_CORBA)
15+
CFLAGS = @CFLAGS@ @CHECK_C_ERRORS@ $(USE_CORBA)
1616
OMPCC = @CC@ @OMPCFLAGS@
1717
OMBUILDDIR = @OMBUILDDIR@
1818
OMC=@OMC@

SimulationRuntime/c/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ IPOPT_CFLAGS=@IPOPT_CFLAGS@
1919
else
2020
IPOPT_CFLAGS=
2121
endif
22-
CONFIG_CFLAGS = @CFLAGS@ $(IPOPT_CFLAGS)
22+
CONFIG_CFLAGS = @CHECK_C_ERRORS@ @CFLAGS@ $(IPOPT_CFLAGS)
2323
FPMATHFORTRAN = @FPMATHFORTRAN@
2424
OMBUILDDIR = @OMBUILDDIR@
2525

SimulationRuntime/c/simulation/solver/dassl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,7 @@ dassl_initial(DATA* simData, threadData_t *threadData, SOLVER_INFO* solverInfo,
9393
int
9494
dassl_deinitial(DASSL_DATA *dasslData);
9595

96+
int printCurrentStatesVector(int logLevel, double* states, DATA* data, double time);
97+
int printVector(int logLevel, const char* name, double* vec, int n, double time);
98+
9699
#endif

SimulationRuntime/c/simulation/solver/ida_solver.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include "simulation/solver/epsilon.h"
5252
#include "simulation/solver/omc_math.h"
5353
#include "simulation/solver/ida_solver.h"
54+
#include "simulation/solver/dassl.h"
5455

5556
#ifdef WITH_SUNDIALS
5657

@@ -298,7 +299,7 @@ ida_solver_initial(DATA* data, threadData_t *threadData, SOLVER_INFO* solverInfo
298299
flag = IDASetMaxOrd(idaData->ida_mem, maxOrder);
299300
if (checkIDAflag(flag)){
300301
throwStreamPrint(threadData, "##IDA## Failed to set max integration order!");
301-
}
302+
}
302303
}
303304
infoStreamPrint(LOG_SOLVER, 0, "maximum integration order %d", maxOrder);
304305

@@ -911,7 +912,7 @@ ida_solver_step(DATA* data, threadData_t *threadData, SOLVER_INFO* solverInfo)
911912
}
912913
} else {
913914
break;
914-
}
915+
}
915916
}
916917

917918
} while(!finished);

configure.ac

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ AC_SUBST(with_paradiseo_include)
1212
AC_SUBST(with_paradiseo_lib)
1313
AC_SUBST(with_qwt)
1414
AC_SUBST(with_qwt_suffix)
15+
AC_SUBST(CHECK_C_ERRORS)
1516
AC_SUBST(EXTRA_CFLAGS_GENERATED_CODE)
1617
AC_SUBST(HAVE_GETTEXT)
1718
AC_SUBST(LIBSOCKET)
@@ -206,9 +207,19 @@ for flag in $TRY_FLAGS; do
206207
AC_TRY_LINK([], [return 0;], [CFLAGS="$OLD_CFLAGS $flag"],[CFLAGS="$OLD_CFLAGS"])
207208
done
208209
OLD_CFLAGS="$CFLAGS"
209-
for flag in -Wno-parentheses-equality -Wno-unused-variable -Werror=implicit-function-declaration; do
210+
for flag in -Wno-parentheses-equality -Wno-unused-variable; do
210211
CFLAGS="$RUNTIMECFLAGS $flag -Werror"
211-
AC_TRY_LINK([], [return 0;], [EXTRA_CFLAGS_GENERATED_CODE="$EXTRA_CFLAGS_GENERATED_CODE $flag"],[])
212+
AC_TRY_LINK([], [return 0;], [
213+
CHECK_C_ERRORS="$CHECK_C_ERRORS $flag"
214+
EXTRA_CFLAGS_GENERATED_CODE="$EXTRA_CFLAGS_GENERATED_CODE $flag"
215+
],[])
216+
done
217+
for flag in -Werror=implicit-function-declaration; do
218+
CFLAGS="$RUNTIMECFLAGS $flag -Werror"
219+
AC_TRY_LINK([], [return 0;], [
220+
CHECK_C_ERRORS="$CHECK_C_ERRORS $flag"
221+
EXTRA_CFLAGS_GENERATED_CODE="$EXTRA_CFLAGS_GENERATED_CODE $flag"
222+
],[])
212223
done
213224
CFLAGS="$OLD_CFLAGS"
214225

0 commit comments

Comments
 (0)