From 758a945856ea1cde79a04601165d26df68d3b34b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Mon, 16 Jan 2012 23:23:19 +0100
Subject: [PATCH] Added workarounds and options for gcc 4.6.2
* add -Wno-unused-but-set-variable for gcc 4.6.x with a TODO
* fix warnings about wrong size of pointer cast in ioapic.cpp and AudioBuffer.cpp
---
build/jam/BuildSetup | 28 ++++++++++++------------
build/scripts/build_cross_tools_gcc4 | 2 +-
src/apps/cortex/addons/common/AudioBuffer.cpp | 4 +-
src/system/kernel/arch/x86/ioapic.cpp | 4 +-
4 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup
index c46977e..de35d5f 100644
a
|
b
|
AUTO_SET_UP_CONFIG_VARIABLES +=
|
1185 | 1185 | |
1186 | 1186 | |
1187 | 1187 | # enable -Werror for certain parts of the source tree |
1188 | | |
1189 | | if $(HAIKU_GCC_VERSION[1]) = 2 { |
1190 | | rule EnableWerror dirTokens : scope { |
1191 | | AppendToConfigVar CCFLAGS : HAIKU_TOP $(dirTokens) : -Werror |
1192 | | : $(scope) ; |
1193 | | AppendToConfigVar C++FLAGS : HAIKU_TOP $(dirTokens) : -Werror |
1194 | | : $(scope) ; |
1195 | | } |
1196 | | } else { |
| 1188 | WERRORFLAGS = ; |
| 1189 | if $(HAIKU_GCC_VERSION[1]) >= 4 { |
1197 | 1190 | # -Wuninitialized gives too many false positives. |
1198 | | rule EnableWerror dirTokens : scope { |
1199 | | AppendToConfigVar CCFLAGS : HAIKU_TOP $(dirTokens) |
1200 | | : -Werror -Wno-error=uninitialized : $(scope) ; |
1201 | | AppendToConfigVar C++FLAGS : HAIKU_TOP $(dirTokens) |
1202 | | : -Werror -Wno-error=uninitialized : $(scope) ; |
| 1191 | WERRORFLAGS = -Wno-error=uninitialized ; |
| 1192 | |
| 1193 | if $(HAIKU_GCC_VERSION[2]) >= 6 { |
| 1194 | # TODO: remove the -Wno-unused-but-set-variable option |
| 1195 | WERRORFLAGS += -Wno-unused-but-set-variable ; |
1203 | 1196 | } |
1204 | 1197 | } |
1205 | 1198 | |
| 1199 | rule EnableWerror dirTokens : scope { |
| 1200 | AppendToConfigVar CCFLAGS : HAIKU_TOP $(dirTokens) : -Werror $(WERRORFLAGS) |
| 1201 | : $(scope) ; |
| 1202 | AppendToConfigVar C++FLAGS : HAIKU_TOP $(dirTokens) : -Werror $(WERRORFLAGS) |
| 1203 | : $(scope) ; |
| 1204 | } |
| 1205 | |
1206 | 1206 | # Work-around for GCC 2 problem -- despite -Wno-multichar it reports |
1207 | 1207 | # multichar warnings in headers/private/kernel/debugger_keymaps.h included by |
1208 | 1208 | # src/system/kernel/arch/x86/arch_debug_console.cpp. |
diff --git a/build/scripts/build_cross_tools_gcc4 b/build/scripts/build_cross_tools_gcc4
index fa20f7c..3c4ba83 100755
a
|
b
|
copy_headers $haikuSourceDir/headers/posix $tmpIncludeDir/posix
|
144 | 144 | cd $gccObjDir |
145 | 145 | CFLAGS="-O2" CXXFLAGS="-O2" $gccSourceDir/configure --prefix=$installDir \ |
146 | 146 | --target=$haikuMachine --disable-nls --disable-shared \ |
147 | | --enable-languages=c,c++ \ |
| 147 | --enable-languages=c,c++ --enable-lto --enable-frame-pointer \ |
148 | 148 | --with-headers=$tmpIncludeDir --with-libs=$tmpLibDir \ |
149 | 149 | $gccConfigureArgs || exit 1 |
150 | 150 | |
diff --git a/src/apps/cortex/addons/common/AudioBuffer.cpp b/src/apps/cortex/addons/common/AudioBuffer.cpp
index 47613bb..f092127 100644
a
|
b
|
uint32 AudioBuffer::copyTo(
|
223 | 223 | // convert and copy a sample at a time |
224 | 224 | for(; remaining; remaining -= sampleSize) { |
225 | 225 | convert_sample( |
226 | | (void*) *((int8*)m_pData + fromOffset), |
227 | | (void*) *((int8*)target.m_pData + targetOffset), |
| 226 | (void*) ((int8*)m_pData + fromOffset), |
| 227 | (void*) ((int8*)target.m_pData + targetOffset), |
228 | 228 | m_format.format, |
229 | 229 | target.m_format.format); |
230 | 230 | |
diff --git a/src/system/kernel/arch/x86/ioapic.cpp b/src/system/kernel/arch/x86/ioapic.cpp
index 78f6129..6d40b16 100644
a
|
b
|
acpi_configure_source_overrides(acpi_table_madt* madt)
|
529 | 529 | if (info->SourceIrq != info->GlobalIrq) { |
530 | 530 | // we need a vector mapping |
531 | 531 | install_io_interrupt_handler(info->GlobalIrq, |
532 | | &ioapic_source_override_handler, (void*)info->SourceIrq, |
533 | | B_NO_ENABLE_COUNTER); |
| 532 | &ioapic_source_override_handler, |
| 533 | (void*)(addr_t)info->SourceIrq, B_NO_ENABLE_COUNTER); |
534 | 534 | |
535 | 535 | sSourceOverrides[info->SourceIrq] = info->GlobalIrq; |
536 | 536 | } |