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/usr | |
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/usr')
-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 |
12 files changed, 61 insertions, 19 deletions
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; |