--- a/arm-tidl/onnxrt_ep/src/concerto_common.mak 2022-12-20 00:04:22.000000000 +0000 +++ b/arm-tidl/onnxrt_ep/src/concerto_common.mak 2023-04-24 10:50:28.586491914 +0100 @@ -26,4 +26,5 @@ -Wno-unused-but-set-variable \ -Wno-unused-result \ -Wno-format-overflow \ - -Wno-format-truncation + -Wno-format-truncation \ + -Werror=return-type --- a/arm-tidl/rt/src/concerto_common.mak 2022-12-20 00:04:21.000000000 +0000 +++ b/arm-tidl/rt/src/concerto_common.mak 2023-04-24 10:50:16.170516566 +0100 @@ -1,6 +1,6 @@ TARGET := vx_tidl_rt TARGETTYPE := dsmo -CFLAGS += -fPIC -Wno-int-to-pointer-cast -Wno-stringop-truncation -Wno-format-overflow +CFLAGS += -fPIC -Wno-int-to-pointer-cast -Wno-stringop-truncation -Wno-format-overflow -Werror=return-type CPPFLAGS += -fPIC --std=c++11 CSOURCES += ../tidl_rt_ovx.c --- a/makerules/rules.mk 2022-12-20 00:04:21.000000000 +0000 +++ b/makerules/rules.mk 2023-04-24 13:04:16.778657781 +0100 @@ -224,13 +224,13 @@ endif ifeq ($(TARGET_BUILD), debug) - COMPILER_FLAGS += -std=c++14 -DHOST_EMULATION -w -D_HOST_BUILD -DGCC_BUILD + COMPILER_FLAGS += -std=c++14 -DHOST_EMULATION -D_HOST_BUILD -DGCC_BUILD -Werror=return-type GCC_DEBUG_CFLAGS :=-ggdb -ggdb3 -gdwarf-2 else ifeq ($(DEVELOPER_BUILD), 0) - COMPILER_FLAGS += -std=c++14 -O3 -DHOST_EMULATION -D_HOST_BUILD -DGCC_BUILD + COMPILER_FLAGS += -std=c++14 -O3 -DHOST_EMULATION -D_HOST_BUILD -DGCC_BUILD -Werror=return-type else - COMPILER_FLAGS += -std=c++14 -O3 -DHOST_EMULATION -D_HOST_BUILD -DGCC_BUILD -g + COMPILER_FLAGS += -std=c++14 -O3 -DHOST_EMULATION -D_HOST_BUILD -DGCC_BUILD -g -Werror=return-type endif endif LD=g++-5 Binary files a/ti_dl/test/j7-c71_0-fw and b/ti_dl/test/j7-c71_0-fw differ --- a/ti_dl/utils/tidlModelGraphviz/tidl_graph_model_runtimes.cpp 2022-12-20 00:04:27.000000000 +0000 +++ b/ti_dl/utils/tidlModelGraphviz/tidl_graph_model_runtimes.cpp 2023-04-24 08:30:03.523153079 +0100 @@ -56,7 +56,7 @@ "#EE82EE", //"Scale" }; -void * TIDL_readAllowlistNodesFile(char * fname, std::vector>& supportedNodeGroups) +void TIDL_readAllowlistNodesFile(char * fname, std::vector>& supportedNodeGroups) { std::ifstream fAllowlistNode(fname); --- a/ti_dl/utils/tidlModelImport/makefile_bin 2022-12-20 00:04:27.000000000 +0000 +++ b/ti_dl/utils/tidlModelImport/makefile_bin 2023-04-24 12:30:43.494549119 +0100 @@ -98,7 +98,7 @@ CFLAGS += /DTIDL_IMPORT_TOOL else CFLAGS += -D_GNU_SOURCE -CFLAGS += -DTIDL_IMPORT_TOOL -w +CFLAGS += -DTIDL_IMPORT_TOOL -Werror=return-type endif ############################################################## --- a/ti_dl/utils/tidlModelImport/makefile_lib 2022-12-20 00:04:27.000000000 +0000 +++ b/ti_dl/utils/tidlModelImport/makefile_lib 2023-04-24 12:30:50.454535298 +0100 @@ -116,7 +116,7 @@ ifdef SystemRoot CFLAGS+= /DTIDL_IMPORT_TOOL else -CFLAGS+= -DTIDL_IMPORT_TOOL -w +CFLAGS+= -DTIDL_IMPORT_TOOL -Werror=return-type endif ############################################################## --- a/ti_dl/utils/tidlModelImport/makefile_shared 2022-12-20 00:04:27.000000000 +0000 +++ b/ti_dl/utils/tidlModelImport/makefile_shared 2023-04-24 13:40:36.814848128 +0100 @@ -181,7 +181,7 @@ CFLAGS += /DDLL_EXPORT else CFLAGS += -D_GNU_SOURCE -CFLAGS += -DTIDL_IMPORT_TOOL -w +CFLAGS += -DTIDL_IMPORT_TOOL -Werror=return-type endif ifeq ($(MAKECMDGOALS),tvm_relay) --- a/ti_dl/utils/tidlModelImport/tidl_import_common.cpp 2023-04-24 13:38:45.283719711 +0100 +++ b/ti_dl/utils/tidlModelImport/tidl_import_common.cpp 2023-04-24 12:10:00.353017409 +0100 @@ -922,6 +922,8 @@ { fclose(fp1); } + + return 0; } void TIDL_UpdateInDataBuffId(sTIDL_OrgNetwork_t * pOrgTIDLNetStructure, @@ -1650,6 +1652,7 @@ fwrite(&gIOParams, 1, sizeof(sTIDL_IOBufDesc_t), fp1); fclose(fp1); + return 0; } --- a/ti_dl/utils/tidlModelImport/tidl_import_common_model_check.cpp 2022-12-20 00:04:27.000000000 +0000 +++ b/ti_dl/utils/tidlModelImport/tidl_import_common_model_check.cpp 2023-04-24 11:00:02.057353286 +0100 @@ -461,6 +461,8 @@ return TIDL_ALLOWLISTING_LAYER_CHECK_FAILED; } } + + return 0; } static void checkConvLayers(const sTIDL_LayerPC_t &layerPC, DiagList_t &diags) { --- a/ti_dl/utils/tidlModelImport/tidl_import_core.cpp 2022-12-20 00:04:27.000000000 +0000 +++ b/ti_dl/utils/tidlModelImport/tidl_import_core.cpp 2023-04-24 12:09:15.497106472 +0100 @@ -558,7 +558,7 @@ { printf("%s\n", sysCommand); } - system(sysCommand); + return system(sysCommand); } int tidlRunModelDumpTool(tidl_import_config * params) @@ -586,7 +586,7 @@ { printf("%s\n", sysCommand); } - system(sysCommand); + return system(sysCommand); } int tidlWriteTensorNamesToFile(tidl_import_config * params, const char* suffix) @@ -623,6 +623,7 @@ } free(tidlNet); fclose(layerInfoFile); + return 0; } /** This function removes the string "tidl_net_" and ".bin" from the net bin file names to reduce the folder name size for perfsim @@ -1198,6 +1199,8 @@ { pTIDLNetStructure->isQuantStatsAvailable = quantStatus; } + + return 0; } void tidl_updateNetPitch(sTIDL_Network_t * tidlNet) --- a/ti_dl/utils/tidlModelImport/tidl_import_quantize.cpp 2022-12-20 00:04:27.000000000 +0000 +++ b/ti_dl/utils/tidlModelImport/tidl_import_quantize.cpp 2023-04-24 12:14:34.552472971 +0100 @@ -2341,6 +2341,7 @@ /* Run quant stats again to save the final min/max statistics after bias calibration */ // tidlRunQuantStatsTool((void**)&perChannelMeanPtrFloat); + return 0; } --- a/ti_dl/utils/tidlModelImport/tidl_runtimes_import_common.cpp 2022-12-20 00:04:27.000000000 +0000 +++ b/ti_dl/utils/tidlModelImport/tidl_runtimes_import_common.cpp 2023-04-24 12:37:52.093698124 +0100 @@ -710,6 +710,8 @@ printf("Please provide TIDL tools path \n"); exit(-1); } + + return 0; } /** Add output data layer to subgraph */ @@ -785,6 +787,8 @@ gParams.rawDataInElementType[i] = TIDL_SignedWord; } } + + return 0; } /** This function calls "TIDL_import_backend" to run calibration, quantization and save the final network files */ --- a/ti_dl/utils/tidlModelImport/tidl_tfImport.cpp 2022-12-20 00:04:27.000000000 +0000 +++ b/ti_dl/utils/tidlModelImport/tidl_tfImport.cpp 2023-04-24 12:10:32.700953181 +0100 @@ -1259,6 +1259,8 @@ strcat(outList, ","); } } + + return 0; } int32_t tidl_tfLayerFillTensorNames(sTIDL_OrgNetwork_t *pOrgTIDLNetStructure, --- a/ti_dl/utils/tidlModelImport/tidl_tfLiteImport.cpp 2022-12-20 00:04:27.000000000 +0000 +++ b/ti_dl/utils/tidlModelImport/tidl_tfLiteImport.cpp 2023-04-24 12:11:21.556856176 +0100 @@ -322,6 +322,7 @@ printf("\nOnly float, DT_INT32 and DT_UNT8 tensor is suported \n"); return -1; } + return 0; } bool isTensorVariable(const Model* tfliteModel,int32_t idx) @@ -1333,6 +1334,7 @@ return -1; } + return 0; } int32_t TIDL_tfliteMapReluParams(sTIDL_OrgNetwork_t *pOrgTIDLNetStructure, --- a/ti_dl/test/src/concerto_common.mak 2022-12-20 00:04:28.000000000 +0000 +++ b/ti_dl/test/src/concerto_common.mak 2023-04-25 12:41:17.620684302 +0100 @@ -51,6 +51,10 @@ DEFS+=DMA_UTILS_STANDALONE endif +ifeq ($(TARGET_PLATFORM),PC) + CFLAGS += -Werror=return-type +endif + #ifeq ($(TIDL_BUILD_FOR_QT), 1) DEFS+=TIDL_BUILD_FOR_QT #endif --- a/ti_dl/test/src/tidl_rt.c 2022-12-20 00:04:28.000000000 +0000 +++ b/ti_dl/test/src/tidl_rt.c 2023-04-25 12:42:50.396648161 +0100 @@ -256,13 +256,14 @@ return; } -tidl_printDdrStats(uint64_t read_bytes, uint64_t write_bytes) +int tidl_printDdrStats(uint64_t read_bytes, uint64_t write_bytes) { #if (!HOST_EMULATION) #if ENABLE_DDR_BW_STATS tidl_tb_printf(0, " DDR_READ_WRITE_TOTAL_MB = %8.2f, %8.2f, %8.2f ", (ddr_read / 1000000.0), (ddr_write / 1000000.0), ((ddr_read + ddr_write) / 1000000.0)); #endif #endif + return 0; } #if (!HOST_EMULATION)