diff options
author | Luis Fernandez <luis.fernandez@ibm.com> | 2019-02-21 14:13:44 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-04-05 16:52:10 -0500 |
commit | 4995ec0ba6f15e03deb4b9ad1dc215f3f8993acb (patch) | |
tree | 35524433b3a4b268b12516cfdf2dd033688599b2 /src | |
parent | c8651104f00db7538147ab4cea9c9a3a8df5e500 (diff) | |
download | talos-hostboot-4995ec0ba6f15e03deb4b9ad1dc215f3f8993acb.tar.gz talos-hostboot-4995ec0ba6f15e03deb4b9ad1dc215f3f8993acb.zip |
HB Improvements: Fix compiler warnings on modern compilers
Resolve warnings when compiling with gcc 4.8. Compiled with GCC 7.3,
no more compile errors/warnings; build ends with caught exception from
linker. This commit compiles with GCC 8.2, no more error/warnings; except
for a linking warning.
Change-Id: Ib5d7c2b5bd350edc76ee2c7de96896154cd44420
RTC: 202716
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72271
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/build/linker/linker.C | 39 | ||||
-rw-r--r-- | src/build/mkrules/cflags.env.mk | 14 | ||||
-rw-r--r-- | src/include/array | 6 | ||||
-rw-r--r-- | src/include/usr/devicefw/driverif.H | 22 | ||||
-rw-r--r-- | src/include/usr/targeting/common/target.H | 55 | ||||
-rw-r--r-- | src/include/util/locked/list.H | 10 | ||||
-rw-r--r-- | src/lib/utilmisc.C | 11 | ||||
-rw-r--r-- | src/usr/devicefw/driverif.C | 18 | ||||
-rw-r--r-- | src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C | 4 | ||||
-rw-r--r-- | src/usr/diag/prdf/prdfErrlUtil.H | 4 | ||||
-rw-r--r-- | src/usr/errl/errludlogregister.C | 20 | ||||
-rw-r--r-- | src/usr/hdat/hdatcommonutil.C | 2 | ||||
-rw-r--r-- | src/usr/isteps/istep10/call_proc_cen_ref_clk_enable.C | 4 | ||||
-rw-r--r-- | src/usr/isteps/istep10/host_proc_pcie_scominit.C | 6 | ||||
-rw-r--r-- | src/usr/isteps/nvdimm/errlud_nvdimm.C | 2 | ||||
-rw-r--r-- | src/usr/sbeio/sbe_securityListBinDump.C | 2 | ||||
-rw-r--r-- | src/usr/targeting/common/target.C | 4 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/xmltohb.pl | 12 | ||||
-rw-r--r-- | src/usr/testcore/rtloader/loader.H | 2 |
19 files changed, 161 insertions, 76 deletions
diff --git a/src/build/linker/linker.C b/src/build/linker/linker.C index 9e4751e41..a9a9d0f5e 100644 --- a/src/build/linker/linker.C +++ b/src/build/linker/linker.C @@ -283,6 +283,36 @@ inline void advance_to_page_align(FILE * i_f) } } +/** + * @brief Throw error if std::fread was performed incorrectly. + * @param[i] i_buffer: pointer to the first object in the array to be read + * @param[i] i_size: size of each object in i_buffer array, in bytes + * @param[i] i_count: number of the objects in i_buffer array to be read + * @param[i] i_stream: input-file pointer + */ +inline void fread_wrapper(void* i_buffer, const size_t i_size, + const size_t i_count, FILE* i_stream) +{ + + size_t n_values_read = fread(i_buffer,i_size,i_count,i_stream); + + if (i_count != n_values_read) + { + if (feof(i_stream)) + { + throw "End of file reached, file not read fully."; + } + else if (ferror(i_stream)) + { + throw "Error occurred while reading file."; + } + else + { + throw "Unknown read error."; + } + } +} + // // Global variables // @@ -669,7 +699,7 @@ bool Object::write_object() long int file_size = ftell(file); uint8_t * buffer = new uint8_t[file_size]; fseek(file,0,SEEK_SET); - fread(buffer,file_size,1,file); + fread_wrapper(buffer,file_size,1,file); fwrite(buffer,file_size,1,iv_output); delete [] buffer; fclose(file); @@ -895,7 +925,7 @@ bool Object::perform_local_relocations() bool is_weak = false; fseek(iv_output, offset + i->address, SEEK_SET); - fread(data, sizeof(uint64_t), 1, iv_output); + fread_wrapper(data, sizeof(uint64_t), 1, iv_output); if (weak_symbols.find(i->name) != weak_symbols.end()) { @@ -1024,7 +1054,8 @@ bool Object::perform_global_relocations() } fseek(j->iv_output, symbol_addr, SEEK_SET); - fread(data, sizeof(uint64_t), 3, j->iv_output); + fread_wrapper(data, sizeof(uint64_t), 3, + j->iv_output); fseek(iv_output, offset + i->address, SEEK_SET); fwrite(data, sizeof(uint64_t), 3, iv_output); @@ -1172,7 +1203,7 @@ void ModuleTable::write_table(vector<Object> & i_objects) cout << "Updating base module table..." << endl; fseek(iv_output, module_table_offset, SEEK_SET); char mx_mod_ch = 0; - fread(&mx_mod_ch,sizeof(char),1,iv_output); + fread_wrapper(&mx_mod_ch,sizeof(char),1,iv_output); max_modules = (uint64_t)mx_mod_ch; // VFS_MODULE_MAX; ++i; } diff --git a/src/build/mkrules/cflags.env.mk b/src/build/mkrules/cflags.env.mk index 732e6559e..04ff6fedd 100644 --- a/src/build/mkrules/cflags.env.mk +++ b/src/build/mkrules/cflags.env.mk @@ -38,22 +38,14 @@ CFLAGS += -DNO_INITIALIZER_LIST CFLAGS += -D__FAPI endif -try = $(shell set -e; if ($(1)) >/dev/null 2>&1; \ - then echo "$(2)"; \ - else echo "$(3)"; fi ) - -try-cflag = $(call try,$(1) $(2) -x c -c /dev/null -o /dev/null,$(2)) -test_cflag = $(call try,$(1) $(2) -x c -c /dev/null -o /dev/null,1,0) COMMONFLAGS += $(OPT_LEVEL) -nostdlib CFLAGS += $(COMMONFLAGS) -mcpu=power7 -nostdinc -g -mno-vsx -mno-altivec\ - -Wall -mtraceback=no -pipe -mabi=elfv1 \ - $(call try-cflag,$(CC),-Wno-error=sizeof-array-argument) \ - $(call try-cflag,$(CC),-Wno-error=unused-function) \ + -Werror -Wall -mtraceback=no -pipe -mabi=elfv1 \ -ffunction-sections -fdata-sections -ffreestanding -mbig-endian ASMFLAGS += $(COMMONFLAGS) -mcpu=power7 -mbig-endian -ffreestanding -mabi=elfv1 -CXXFLAGS += $(CFLAGS) -nostdinc++ -fno-rtti -fno-exceptions -Wall \ - -fuse-cxa-atexit -std=gnu++14 -fpermissive +CXXFLAGS += $(CFLAGS) -nostdinc++ -fno-rtti -fno-exceptions -Werror -Wall \ + -fuse-cxa-atexit -std=gnu++14 LDFLAGS += --nostdlib --sort-common -EB $(COMMONFLAGS) INCFLAGS = $(addprefix -I, $(INCDIR) ) diff --git a/src/include/array b/src/include/array index 76b1371c8..5c221d7dd 100644 --- a/src/include/array +++ b/src/include/array @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -179,7 +179,7 @@ namespace std * @pre None. * @post None. */ - constexpr size_type size() + constexpr size_type size() const { return N; } @@ -505,4 +505,4 @@ namespace std } -#endif
\ No newline at end of file +#endif diff --git a/src/include/usr/devicefw/driverif.H b/src/include/usr/devicefw/driverif.H index e91c43518..048b8dc19 100644 --- a/src/include/usr/devicefw/driverif.H +++ b/src/include/usr/devicefw/driverif.H @@ -405,8 +405,10 @@ namespace DeviceFW TargType i_targetType, deviceOp_t i_regRoute) { - InvalidParameterType(); // Cause a compile fail if not one of - // the explicit template specializations. + // Cause a compile fail if not one of + // the explicit template specializations. + static_assert(sizeof(OpType) != sizeof(OpType), "Must use an " + "explicitly supported template specialization"); } /** Assistance macro for stringification. */ @@ -463,8 +465,12 @@ namespace DeviceFW void* io_buffer, size_t& io_buflen, AccType i_accessType, ...) { - return InvalidParameterType(); // Cause a compile fail if not one of - // the explicit template specializations. + // Cause a compile fail if not one of + // the explicit template specializations. + static_assert(sizeof(AccType) != sizeof(AccType), "Must use" + " an explicitly supported template specialization"); + errlHndl_t errl = nullptr; + return errl; } /** @@ -488,8 +494,12 @@ namespace DeviceFW void* io_buffer, size_t& io_buflen, AccType i_accessType, va_list i_args) { - return InvalidParameterType(); // Cause a compile fail if not one of - // the explicit template specializations. + // Cause a compile fail if not one of + // the explicit template specializations. + static_assert(sizeof(AccType) != sizeof(AccType), "Must use" + " an explicitly supported template specialization"); + errlHndl_t errl = nullptr; + return errl; } // --- Below are template specializations to aid in type-safety. --- diff --git a/src/include/usr/targeting/common/target.H b/src/include/usr/targeting/common/target.H index 16622adf9..08fcb3f76 100644 --- a/src/include/usr/targeting/common/target.H +++ b/src/include/usr/targeting/common/target.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2018 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -846,31 +846,33 @@ template<const ATTRIBUTE_ID A> bool Target::tryGetAttrNotSynced( typename AttributeTraits<A>::Type& o_attrValue) const { - if(AttributeTraits<A>::readable) { } - if(AttributeTraits<A>::notHbMutex) { } - if(AttributeTraits<A>::notFspMutex) { } + if(AttributeTraits<A>::readable == AttributeTraits<A>::readable) { } + if(AttributeTraits<A>::notHbMutex == AttributeTraits<A>::notHbMutex) { } + if(AttributeTraits<A>::notFspMutex == AttributeTraits<A>::notFspMutex) { } return _tryGetAttr(A,sizeof(o_attrValue),&o_attrValue); } template<const ATTRIBUTE_ID A> bool Target::tryGetAttr(typename AttributeTraits<A>::Type& o_attrValue) const { - if(AttributeTraits<A>::readable) { } - if(AttributeTraits<A>::notHbMutex) { } + if(AttributeTraits<A>::readable == AttributeTraits<A>::readable) { } + if(AttributeTraits<A>::notHbMutex == AttributeTraits<A>::notHbMutex) { } #if !defined(__HOSTBOOT_MODULE) && !defined(__HOSTBOOT_RUNTIME) - if(AttributeTraits<A>::notFspMutex) { } + if(AttributeTraits<A>::notFspMutex == AttributeTraits<A>::notFspMutex) { } #endif //!defined(__HOSTBOOT_MODULE) && !defined(__HOSTBOOT_RUNTIME) - if(AttributeTraits<A>::fspAccessible) { } + if(AttributeTraits<A>::fspAccessible == AttributeTraits<A>::fspAccessible) + { } return _tryGetAttr(A,sizeof(o_attrValue),&o_attrValue); } template<const ATTRIBUTE_ID A> bool Target::trySetAttr(typename AttributeTraits<A>::Type const& i_attrValue) { - if(AttributeTraits<A>::writeable) { } - if(AttributeTraits<A>::notHbMutex) { } + if(AttributeTraits<A>::writeable == AttributeTraits<A>::writeable) { } + if(AttributeTraits<A>::notHbMutex == AttributeTraits<A>::notHbMutex) { } #if !defined(__HOSTBOOT_MODULE) && !defined(__HOSTBOOT_RUNTIME) - if(AttributeTraits<A>::fspAccessible) { } + if(AttributeTraits<A>::fspAccessible == AttributeTraits<A>::fspAccessible) + { } #endif //!defined(__HOSTBOOT_MODULE) && !defined(__HOSTBOOT_RUNTIME) return _trySetAttr(A,sizeof(i_attrValue),&i_attrValue); } @@ -879,8 +881,8 @@ template<const ATTRIBUTE_ID A> bool Target::trySetAttrNotSynced( typename AttributeTraits<A>::Type const& i_attrValue) { - if(AttributeTraits<A>::writeable) { } - if(AttributeTraits<A>::notHbMutex) { } + if(AttributeTraits<A>::writeable == AttributeTraits<A>::writeable) { } + if(AttributeTraits<A>::notHbMutex == AttributeTraits<A>::notHbMutex) { } return _trySetAttr(A,sizeof(i_attrValue),&i_attrValue); } @@ -903,9 +905,9 @@ typename AttributeTraits<A>::Type Target::getAttr(AttrRP* i_attrRP, i_ppAttrAddr) const { typename AttributeTraits<A>::Type l_attrValue; - if(AttributeTraits<A>::readable) { } - if(AttributeTraits<A>::notHbMutex) { } - if(AttributeTraits<A>::notFspMutex) { } + if(AttributeTraits<A>::readable == AttributeTraits<A>::readable) { } + if(AttributeTraits<A>::notHbMutex == AttributeTraits<A>::notHbMutex) { } + if(AttributeTraits<A>::notFspMutex == AttributeTraits<A>::notFspMutex) { } bool l_read = _tryGetAttrUnsafe(A, sizeof(l_attrValue), @@ -934,18 +936,18 @@ void Target::setAttr(typename AttributeTraits<A>::Type const& i_attrValue) template<const ATTRIBUTE_ID A> mutex_t* Target::getHbMutexAttr() const { - if(AttributeTraits<A>::hbMutex) { } - if(AttributeTraits<A>::readable) { } - if(AttributeTraits<A>::writeable) { } + if(AttributeTraits<A>::hbMutex == AttributeTraits<A>::hbMutex) { } + if(AttributeTraits<A>::readable == AttributeTraits<A>::readable) { } + if(AttributeTraits<A>::writeable == AttributeTraits<A>::writeable) { } return _getHbMutexAttr(A); } template<const ATTRIBUTE_ID A> util::Mutex* Target::getFspMutexAttr() const { - if(AttributeTraits<A>::fspMutex) { } - if(AttributeTraits<A>::readable) { } - if(AttributeTraits<A>::writeable) { } + if(AttributeTraits<A>::fspMutex == AttributeTraits<A>::fspMutex) { } + if(AttributeTraits<A>::readable == AttributeTraits<A>::readable) { } + if(AttributeTraits<A>::writeable == AttributeTraits<A>::writeable) { } return _getFspMutexAttr(A); } @@ -953,9 +955,9 @@ template<const ATTRIBUTE_ID A> bool Target::tryGetHbMutexAttr( mutex_t*& o_pMutex) const { - if(AttributeTraits<A>::hbMutex) { } - if(AttributeTraits<A>::readable) { } - if(AttributeTraits<A>::writeable) { } + if(AttributeTraits<A>::hbMutex == AttributeTraits<A>::hbMutex) { } + if(AttributeTraits<A>::readable == AttributeTraits<A>::readable) { } + if(AttributeTraits<A>::writeable == AttributeTraits<A>::writeable) { } return _tryGetHbMutexAttr(A,o_pMutex); } @@ -965,7 +967,8 @@ const char* Target::getAttrAsString() const // Note: the compiler optimizes the following check (which fails // at compile time if the attribute does not have a string // conversion) away - if(AttributeTraits<A>::hasStringConversion) { } + if(AttributeTraits<A>::hasStringConversion == + AttributeTraits<A>::hasStringConversion) { } typename AttributeTraits<A>::Type l_attrValue; bool l_read = tryGetAttr<A>(l_attrValue); if (unlikely(!l_read)) diff --git a/src/include/util/locked/list.H b/src/include/util/locked/list.H index 6708b383b..31bbd713f 100644 --- a/src/include/util/locked/list.H +++ b/src/include/util/locked/list.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2010,2014 */ +/* Contributors Listed Below - COPYRIGHT 2010,2019 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -42,9 +44,9 @@ namespace Util void insert(_T*); void erase(_T* node); - void erase(_K& key); + _T* erase(_K& key); - _T* find(_K& key) const; + _T* find(_K& key) const; bool empty(); _T* begin(); @@ -156,7 +158,7 @@ namespace Util } template <typename _T, typename _K, bool locked, typename _S> - void List<_T,_K,locked,_S>::erase(_K& key) + _T* List<_T,_K,locked,_S>::erase(_K& key) { __lock(); diff --git a/src/lib/utilmisc.C b/src/lib/utilmisc.C index 36f568d11..a3771a303 100644 --- a/src/lib/utilmisc.C +++ b/src/lib/utilmisc.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -29,14 +29,19 @@ namespace Util { bool isSimics() __attribute__((alias("__isSimicsRunning"))); -extern "C" void __isSimicsRunning() NEVER_INLINE; +extern "C" bool __isSimicsRunning() NEVER_INLINE; -void __isSimicsRunning() +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type" + +bool __isSimicsRunning() { asm volatile("li 3, 0"); MAGIC_INSTRUCTION(MAGIC_SIMICS_CHECK); } +#pragma GCC diagnostic pop + bool isSimicsRunning() { static bool simics = isSimics(); diff --git a/src/usr/devicefw/driverif.C b/src/usr/devicefw/driverif.C index acd2a5a1d..9f7c68995 100644 --- a/src/usr/devicefw/driverif.C +++ b/src/usr/devicefw/driverif.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2019 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -31,6 +33,16 @@ namespace DeviceFW { + +// This extension will silence warnings relating to the mis-match of argument +// types used in the various aliases created in this document. + +// The following flag is only available in GCC 8 +#if __GNUC__ >= 8 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wattribute-alias" +#endif + /** @brief Wrapper function to call singleton instance for registerRoute. * * This is defined as an extern "C" function so that it can be aliased @@ -199,4 +211,8 @@ namespace DeviceFW AccessType_DriverOnly i_accessType, va_list i_args) __attribute__((alias("DeviceFW_deviceOpValist"))); +#if __GNUC__ >= 8 +#pragma GCC diagnostic pop +#endif + }; diff --git a/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C b/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C index f81bfb13d..8b94dc9d9 100644 --- a/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C +++ b/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -1237,7 +1237,7 @@ errlHndl_t writeData( uint8_t * i_hBuf, size_t i_hBufSize, } // end for on targets // Add EC Level dependencies at the end - uint8_t *l_ecDepSourceRegs = (uint8_t *)(&s_ecDepProcRegisters[0]); + uint8_t *l_ecDepSourceRegs = (uint8_t *)(&s_ecDepProcRegisters); memcpy( &i_hBuf[idx], l_ecDepSourceRegs, sizeof(s_ecDepProcRegisters) ); diff --git a/src/usr/diag/prdf/prdfErrlUtil.H b/src/usr/diag/prdf/prdfErrlUtil.H index 6da0d9b7d..f452c6557 100644 --- a/src/usr/diag/prdf/prdfErrlUtil.H +++ b/src/usr/diag/prdf/prdfErrlUtil.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2018 */ +/* Contributors Listed Below - COPYRIGHT 2013,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -86,7 +86,7 @@ uint64_t l_d2 = io_errl->getUserData2(); \ TRACFCOMP( PRDF::traceDesc,"SRC 16:19 %16llx %16llx", \ l_d1, l_d2 ); \ - if(i_actions) {} \ + if( 0 != (i_actions) ) {} \ errlCommit(io_errl, PRDF_COMP_ID); } /** diff --git a/src/usr/errl/errludlogregister.C b/src/usr/errl/errludlogregister.C index 43742605b..0db5aaca9 100644 --- a/src/usr/errl/errludlogregister.C +++ b/src/usr/errl/errludlogregister.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -39,6 +39,7 @@ namespace ERRORLOG { using namespace TARGETING; +using namespace DeviceFW; extern TARG_TD_t g_trac_errl; @@ -278,6 +279,16 @@ void ErrlUserDetailsLogRegister::copyRegisterData( * * This function will call the readRegister() function to log and do the read. */ + +// This extension will silence warnings relating to the mis-match of argument +// types used in the various aliases created in this document. + +// The following flag is only available in GCC 8 +#if __GNUC__ >= 8 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wattribute-alias" +#endif + template <> void ErrlUserDetailsLogRegister::addData<>( DeviceFW::AccessType i_accessType, ...) @@ -290,6 +301,9 @@ __attribute__((alias("_ZN8ERRORLOG26ErrlUserDetailsLogRegister9__addDataEhz"))); void ErrlUserDetailsLogRegister::__addData( uint8_t i_accessType, ...) { + static_assert(LAST_DRIVER_ACCESS_TYPE <= UINT8_MAX, + "Logic violation, LAST_DRIVER_ACCESS_TYPE is greater than UINT8_MAX."); + TRACDCOMP(g_trac_errl, "LogRegister::addData: type %x", i_accessType); @@ -317,6 +331,10 @@ void ErrlUserDetailsLogRegister::addDataBuffer<>( DeviceFW::AccessType_DriverOnly i_accessType, ...) __attribute__((alias("_ZN8ERRORLOG26ErrlUserDetailsLogRegister15__addDataBufferEPvmhz"))); +#if __GNUC__ >= 8 +#pragma GCC diagnostic pop +#endif // ignoring -Wattribute-alias in GCC 8 + void ErrlUserDetailsLogRegister::__addDataBuffer( void *i_dataBuf, size_t i_dataSize, uint8_t i_accessType, ...) diff --git a/src/usr/hdat/hdatcommonutil.C b/src/usr/hdat/hdatcommonutil.C index ed92e4da8..ebcab484e 100644 --- a/src/usr/hdat/hdatcommonutil.C +++ b/src/usr/hdat/hdatcommonutil.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2017,2018 */ +/* Contributors Listed Below - COPYRIGHT 2017,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/usr/isteps/istep10/call_proc_cen_ref_clk_enable.C b/src/usr/isteps/istep10/call_proc_cen_ref_clk_enable.C index 6448b4147..67a11b775 100644 --- a/src/usr/isteps/istep10/call_proc_cen_ref_clk_enable.C +++ b/src/usr/isteps/istep10/call_proc_cen_ref_clk_enable.C @@ -294,8 +294,8 @@ void handleProcessorSecurityError(TARGETING::Target* i_pProc, { err->addHwCallout(i_pProc, HWAS::SRCI_PRIORITY_LOW, - i_mismatches.val && // for any mismatch - !RC_MASTER_PROC_SBE_KEYS_HASH_MISMATCH? + (i_mismatches.val && // for any mismatch + i_rc != RC_MASTER_PROC_SBE_KEYS_HASH_MISMATCH) ? HWAS::NO_DECONFIG: // don't deconfig the processor HWAS::DELAYED_DECONFIG, HWAS::GARD_NULL); diff --git a/src/usr/isteps/istep10/host_proc_pcie_scominit.C b/src/usr/isteps/istep10/host_proc_pcie_scominit.C index 4ae9d1bb2..8895ed405 100644 --- a/src/usr/isteps/istep10/host_proc_pcie_scominit.C +++ b/src/usr/isteps/istep10/host_proc_pcie_scominit.C @@ -419,8 +419,10 @@ errlHndl_t createElogFromHxKeywordRc( hxKeywordRc i_rc, // make sure we don't access beyond the boundary of i_hxKeywordData // when copying to hxKwdData variable - static_assert((sizeof(i_hxKeywordData) >= sizeof(hxKwdData)), - "createElogFromHxKeywordRc: sizeof(i_hxKeywordData) is less than hxKwdData size"); + static_assert( + (sizeof(ATTR_PEC_PCIE_HX_KEYWORD_DATA_type) >= sizeof(hxKwdData)), + "createElogFromHxKeywordRc: sizeof(i_hxKeywordData) is less than " + "hxKwdData size"); memcpy(&hxKwdData, i_hxKeywordData, sizeof(hxKwdData)); /*@ diff --git a/src/usr/isteps/nvdimm/errlud_nvdimm.C b/src/usr/isteps/nvdimm/errlud_nvdimm.C index 3a87789ce..743297b94 100644 --- a/src/usr/isteps/nvdimm/errlud_nvdimm.C +++ b/src/usr/isteps/nvdimm/errlud_nvdimm.C @@ -150,7 +150,7 @@ UdNvdimmParms::UdNvdimmParms( uint8_t i_opType, memcpy(l_pBuf, l_muxPath, strlen(l_muxPath)); l_pBuf += strlen(l_muxPath); - l_pBuf = '\0'; // add a terminator for ease of parsing + *l_pBuf = '\0'; // add a terminator for ease of parsing ++l_pBuf; free(l_muxPath); diff --git a/src/usr/sbeio/sbe_securityListBinDump.C b/src/usr/sbeio/sbe_securityListBinDump.C index de91ee546..973d48046 100644 --- a/src/usr/sbeio/sbe_securityListBinDump.C +++ b/src/usr/sbeio/sbe_securityListBinDump.C @@ -95,7 +95,7 @@ namespace SBEIO SBE_TRACF(ERR_MRK "sendPsuSecurityBinDumpRequest: Changing 'Command Not Supported' Error Log To Informational."); errl->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL); errl->collectTrace(SBEIO_COMP_NAME); - ERRORLOG::errlCommit(errl, SBEIO_COMP_NAME); + ERRORLOG::errlCommit(errl, SBEIO_COMP_ID); } } diff --git a/src/usr/targeting/common/target.C b/src/usr/targeting/common/target.C index 37489a774..15fedd006 100644 --- a/src/usr/targeting/common/target.C +++ b/src/usr/targeting/common/target.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2018 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -884,8 +884,6 @@ void setFrequencyAttributes( Target * i_sys, TARGETING::TYPE_PROC, true ); // true: return functional procs - TargetHandleList::iterator l_procTarget; - TARG_EXIT(); #undef TARG_FN } diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index 89255aaec..b3370906e 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -1984,9 +1984,17 @@ template<const ATTRIBUTE_ID A> const char* attrToString( typename AttributeTraits<A>::Type const& i_attrValue) { - // Default behavior is to fail the compile if caller attempt to print an + // Default behavior is to fail the compile if caller attempts to print an // unsupported string - return InvalidAttributeForStringification(); + #ifdef __HOSTBOOT_MODULE + static_assert(A != A, \"Must use an explicitly supported template \" + \"specialization\"); + #else + char mustUseTemplateSpecialization[A != A ? 1 : -1]; + #endif + + const char* retVal = NULL; + return retVal; } VERBATIM diff --git a/src/usr/testcore/rtloader/loader.H b/src/usr/testcore/rtloader/loader.H index 64db72dc4..c7f1193ef 100644 --- a/src/usr/testcore/rtloader/loader.H +++ b/src/usr/testcore/rtloader/loader.H @@ -596,7 +596,7 @@ class RuntimeLoaderTest : public CxxTest::TestSuite //fix the offset for the TEST section so that the testcases //don't collide - i_offset = (PNOR::TEST) ? (i_offset+ + i_offset = (l_id==PNOR::TEST) ? (i_offset+ ((PNOR::pnorTestSec_rt_readwrite_offset*9)/8)):i_offset; uint32_t l_flashAddr = l_info.flashAddr + i_offset; |