Merge pull request #440 from a3f/develop
Make function calls without prior declaration an error
This commit is contained in:
commit
779719f5dc
4 changed files with 16 additions and 5 deletions
14
CMakeLists.txt
Normal file → Executable file
14
CMakeLists.txt
Normal file → Executable file
|
@ -12,10 +12,16 @@ else()
|
||||||
set (CMAKE_C_STANDARD 99)
|
set (CMAKE_C_STANDARD 99)
|
||||||
endif()
|
endif()
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
CHECK_C_COMPILER_FLAG("-Werror=pointer-arith" COMPILER_HAS_POINTER_ARITH_TOGGLE)
|
foreach(option -Werror=pointer-arith;-Werror=implicit-function-declaration)
|
||||||
if(COMPILER_HAS_POINTER_ARITH_TOGGLE)
|
CHECK_C_COMPILER_FLAG("${option}" COMPILER_HAS_THOSE_TOGGLES)
|
||||||
set(CMAKE_C_FLAGS "-Werror=pointer-arith ${CMAKE_C_FLAGS}")
|
set(outcome "Failed")
|
||||||
endif()
|
if(COMPILER_HAS_THOSE_TOGGLES)
|
||||||
|
set(CMAKE_C_FLAGS "${option} ${CMAKE_C_FLAGS}")
|
||||||
|
set(outcome "works")
|
||||||
|
endif()
|
||||||
|
message(STATUS "Testing if ${option} can be used -- ${outcome}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(src release)
|
add_subdirectory(src release)
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,8 @@ endif
|
||||||
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
||||||
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
||||||
# -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers
|
# -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers
|
||||||
CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces -Werror=pointer-arith
|
# -Werror=implicit-function-declaration catch function calls without prior declaration
|
||||||
|
CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces -Werror=pointer-arith -Werror=implicit-function-declaration
|
||||||
|
|
||||||
ifeq ($(RAYLIB_BUILD_MODE), DEBUG)
|
ifeq ($(RAYLIB_BUILD_MODE), DEBUG)
|
||||||
CFLAGS += -g
|
CFLAGS += -g
|
||||||
|
|
|
@ -255,6 +255,7 @@ PHYSACDEF void ClosePhysics(void);
|
||||||
// Functions required to query time on Windows
|
// Functions required to query time on Windows
|
||||||
int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount);
|
int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount);
|
||||||
int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency);
|
int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency);
|
||||||
|
#include <time.h>
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
#if _POSIX_C_SOURCE < 199309L
|
#if _POSIX_C_SOURCE < 199309L
|
||||||
#undef _POSIX_C_SOURCE
|
#undef _POSIX_C_SOURCE
|
||||||
|
|
|
@ -74,6 +74,7 @@
|
||||||
#if defined(GRAPHICS_API_OPENGL_11)
|
#if defined(GRAPHICS_API_OPENGL_11)
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
#include <OpenGL/gl.h> // OpenGL 1.1 library for OSX
|
#include <OpenGL/gl.h> // OpenGL 1.1 library for OSX
|
||||||
|
#include <OpenGL/glext.h>
|
||||||
#else
|
#else
|
||||||
#if defined(_MSC_VER) // Using MSVC compiler, requires some additional definitions
|
#if defined(_MSC_VER) // Using MSVC compiler, requires some additional definitions
|
||||||
// APIENTRY for OpenGL function pointer declarations is required
|
// APIENTRY for OpenGL function pointer declarations is required
|
||||||
|
@ -101,6 +102,7 @@
|
||||||
#if defined(GRAPHICS_API_OPENGL_33)
|
#if defined(GRAPHICS_API_OPENGL_33)
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
#include <OpenGL/gl3.h> // OpenGL 3 library for OSX
|
#include <OpenGL/gl3.h> // OpenGL 3 library for OSX
|
||||||
|
#include <OpenGL/gl3ext.h>
|
||||||
#else
|
#else
|
||||||
#define GLAD_IMPLEMENTATION
|
#define GLAD_IMPLEMENTATION
|
||||||
#if defined(RLGL_STANDALONE)
|
#if defined(RLGL_STANDALONE)
|
||||||
|
@ -125,6 +127,7 @@
|
||||||
#include "shader_distortion.h" // Distortion shader to be embedded
|
#include "shader_distortion.h" // Distortion shader to be embedded
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Defines and Macros
|
// Defines and Macros
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue