Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorTorbjörn Svensson2020-10-31 17:21:20 +0000
committerTorbjörn Svensson2020-10-31 19:24:44 +0000
commit908aa33b914ae16cfc13903f75a1cb50e6a91017 (patch)
treec9e4d197ddbbd23d9083f77a71e005809ca37c97 /native
parent570c5b7ff024aa8ec0fda5eb9072d18703204e79 (diff)
downloadorg.eclipse.cdt-908aa33b914ae16cfc13903f75a1cb50e6a91017.tar.gz
org.eclipse.cdt-908aa33b914ae16cfc13903f75a1cb50e6a91017.tar.xz
org.eclipse.cdt-908aa33b914ae16cfc13903f75a1cb50e6a91017.zip
Bug 568079: Activate -Wall -pedantic and fix warnings
Change-Id: I7dac7f9d90dd65cfbff241f9b778bc5ff6bc9db6 Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
Diffstat (limited to 'native')
-rw-r--r--native/org.eclipse.cdt.native.serial/native_src/Makefile11
-rw-r--r--native/org.eclipse.cdt.native.serial/native_src/serial.c2
-rwxr-xr-xnative/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dllbin381152 -> 381152 bytes
3 files changed, 8 insertions, 5 deletions
diff --git a/native/org.eclipse.cdt.native.serial/native_src/Makefile b/native/org.eclipse.cdt.native.serial/native_src/Makefile
index bedec0c6917..e3cbc23cb05 100644
--- a/native/org.eclipse.cdt.native.serial/native_src/Makefile
+++ b/native/org.eclipse.cdt.native.serial/native_src/Makefile
@@ -22,6 +22,7 @@ REPRODUCIBLE_BUILD_WRAPPER := $(shell git rev-parse --show-toplevel)/releng/scri
OS_DIR = ../os
CFLAGS += -fPIC -D_REENTRANT
+COMMON_CFLAGS := -Wall -pedantic
UNAME = $(shell uname)
ifeq ($(UNAME),Linux)
@@ -55,20 +56,20 @@ rebuild: clean all
$(OS_DIR)/win32/x86_64/serial.dll: serial.c
mkdir -p $(dir $@) && \
$(REPRODUCIBLE_BUILD_WRAPPER) \
- x86_64-w64-mingw32-gcc -Iinclude -I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/win32" -shared -o $@ $^
+ x86_64-w64-mingw32-gcc $(COMMON_CFLAGS) -Iinclude -I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/win32" -shared -o $@ $^
$(OS_DIR)/linux/x86_64/libserial.so: serial.c
mkdir -p $(dir $@) && \
- gcc -m64 $(CFLAGS) -Iinclude -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux $(LDFLAGS) -shared -o $@ $^
+ x86_64-linux-gnu-gcc -m64 $(COMMON_CFLAGS) $(CFLAGS) -Iinclude -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux $(LDFLAGS) -shared -o $@ $^
$(OS_DIR)/linux/aarch64/libserial.so: serial.c
mkdir -p $(dir $@) && \
- aarch64-linux-gnu-gcc $(CFLAGS) -Iinclude -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux $(LDFLAGS) -shared -o $@ $^
+ aarch64-linux-gnu-gcc $(COMMON_CFLAGS) $(CFLAGS) -Iinclude -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux $(LDFLAGS) -shared -o $@ $^
$(OS_DIR)/linux/ppc64le/libserial.so: serial.c
mkdir -p $(dir $@)
- powerpc64le-linux-gnu-gcc -m64 -mcpu=power8 $(CFLAGS) -Iinclude -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux $(LDFLAGS) -shared -o $@ serial.c
+ powerpc64le-linux-gnu-gcc $(COMMON_CFLAGS) -m64 -mcpu=power8 $(CFLAGS) -Iinclude -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux $(LDFLAGS) -shared -o $@ serial.c
$(OS_DIR)/macosx/x86_64/libserial.jnilib: serial.c
mkdir -p $(dir $@) && \
- x86_64-apple-darwin17-clang $(CFLAGS) -Iinclude -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin $(LDFLAGS) -dynamiclib -o $@ $^
+ x86_64-apple-darwin17-clang $(COMMON_CFLAGS) $(CFLAGS) -Iinclude -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin $(LDFLAGS) -dynamiclib -o $@ $^
diff --git a/native/org.eclipse.cdt.native.serial/native_src/serial.c b/native/org.eclipse.cdt.native.serial/native_src/serial.c
index fdb2cb85392..5cc51a384f3 100644
--- a/native/org.eclipse.cdt.native.serial/native_src/serial.c
+++ b/native/org.eclipse.cdt.native.serial/native_src/serial.c
@@ -45,6 +45,7 @@
* stage. This method obtains the last error from OS to include in the
* IOException
*/
+#ifndef __APPLE__
#ifndef __MINGW32__
static void closeAndthrowIOException(int fd, JNIEnv *env, const char *msg) {
#else
@@ -61,6 +62,7 @@ static void closeAndthrowIOException(HANDLE handle, JNIEnv *env, const char *msg
jclass cls = (*env)->FindClass(env, "java/io/IOException");
(*env)->ThrowNew(env, cls, buff);
}
+#endif
static void throwIOException(JNIEnv *env, const char *msg) {
char buff[256];
diff --git a/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll b/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
index 20117c924eb..a14bc966cee 100755
--- a/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
+++ b/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
Binary files differ

Back to the top