diff --git a/build.gradle b/build.gradle index 33df5f5..7c8e441 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { } } dependencies { - classpath 'gradle.plugin.edu.wpi.first:native-utils:1.3.0' + classpath 'gradle.plugin.edu.wpi.first:native-utils:1.5.1' classpath 'gradle.plugin.edu.wpi.first.wpilib.versioning:wpilib-version-plugin:2.0' } } diff --git a/config.gradle b/config.gradle index 9ed83b4..2325819 100644 --- a/config.gradle +++ b/config.gradle @@ -1,8 +1,7 @@ import edu.wpi.first.nativeutils.* import org.gradle.internal.os.OperatingSystem -def windowsCompilerArgs = ['/EHsc', '/DNOMINMAX', '/D_SCL_SECURE_NO_WARNINGS', '/D_WINSOCK_DEPRECATED_NO_WARNINGS', - '/Zi', '/FS', '/Zc:inline', '/MT'] +def windowsCompilerArgs = ['/EHsc', '/DNOMINMAX', '/Zi', '/FS', '/Zc:inline', '/MT'] def windowsReleaseCompilerArgs = ['/O2'] def windowsLinkerArgs = [ '/DEBUG:FULL' ] def windowsReleaseLinkerArgs = [ '/OPT:REF', '/OPT:ICF' ] @@ -10,7 +9,7 @@ def windowsReleaseLinkerArgs = [ '/OPT:REF', '/OPT:ICF' ] def linuxCompilerArgs = ['-std=c++11', '-Wformat=2', '-Wall', '-Wextra', '-Werror', '-pedantic', '-Wno-psabi', '-g', '-Wno-unused-parameter', '-fPIC', '-rdynamic', '-Wno-error=deprecated-declarations', '-pthread'] def linuxLinkerArgs = ['-rdynamic', '-pthread'] -def linuxReleaseCompilerArgs = ['-O2'] +def linuxReleaseCompilerArgs = ['-Og'] def linuxDebugCompilerArgs = ['-O0'] def linux32BitArg = '-m32' @@ -142,6 +141,7 @@ if (!project.hasProperty('onlyAthena')) { linkerArgs << linux32BitArg debugCompilerArgs = linuxDebugCompilerArgs releaseCompilerArgs = linuxReleaseCompilerArgs + releaseStripBinaries = true compilerFamily = 'Gcc' detectPlatform = linux32IntelPlatformDetect } @@ -152,6 +152,7 @@ if (!project.hasProperty('onlyAthena')) { linkerArgs = linuxLinkerArgs debugCompilerArgs = linuxDebugCompilerArgs releaseCompilerArgs = linuxReleaseCompilerArgs + releaseStripBinaries = true compilerFamily = 'Gcc' detectPlatform = linux64IntelPlatformDetect } @@ -163,6 +164,7 @@ if (!project.hasProperty('onlyAthena')) { linkerArgs << mac32BitArg debugCompilerArgs = macDebugCompilerArgs releaseCompilerArgs = macReleaseCompilerArgs + releaseStripBinaries = true compilerFamily = 'Clang' detectPlatform = mac32PlatformDetect } @@ -172,6 +174,7 @@ if (!project.hasProperty('onlyAthena')) { compilerArgs = macCompilerArgs debugCompilerArgs = macDebugCompilerArgs releaseCompilerArgs = macReleaseCompilerArgs + releaseStripBinaries = true compilerFamily = 'Clang' detectPlatform = mac64PlatformDetect } @@ -190,6 +193,7 @@ if (project.hasProperty('linuxCross')) { linkerArgs = linuxLinkerArgs debugCompilerArgs = linuxDebugCompilerArgs releaseCompilerArgs = linuxReleaseCompilerArgs + releaseStripBinaries = true skipByDefault = true compilerFamily = 'Gcc' exclude << 'gmock' @@ -206,6 +210,7 @@ if (project.hasProperty('linuxCross')) { linkerArgs = linuxLinkerArgs debugCompilerArgs = linuxDebugCompilerArgs releaseCompilerArgs = linuxReleaseCompilerArgs + releaseStripBinaries = true compilerFamily = 'Gcc' detectPlatform = linuxArmPlatformDetect } diff --git a/src/main/native/cpp/DsClient.cpp b/src/main/native/cpp/DsClient.cpp index a333581..6b7eb99 100644 --- a/src/main/native/cpp/DsClient.cpp +++ b/src/main/native/cpp/DsClient.cpp @@ -121,7 +121,7 @@ void DsClient::Thread::Main() { DEBUG3("found robotIP=" << json.slice(pos + 1, endpos)); // Parse into number - unsigned int ip; + unsigned int ip = 0; if (json.slice(pos + 1, endpos).getAsInteger(10, ip)) continue; // error // If zero, clear the server override diff --git a/src/main/native/cpp/Message.cpp b/src/main/native/cpp/Message.cpp index ebdfda8..52790d6 100644 --- a/src/main/native/cpp/Message.cpp +++ b/src/main/native/cpp/Message.cpp @@ -17,7 +17,7 @@ using namespace nt; std::shared_ptr Message::Read(WireDecoder& decoder, GetEntryTypeFunc get_entry_type) { - unsigned int msg_type; + unsigned int msg_type = 0; if (!decoder.Read8(&msg_type)) return nullptr; auto msg = std::make_shared(static_cast(msg_type), private_init());