nginx upload 模組build錯誤解決error: variable ‘result’ set but not used [-Werror=unused-but-set-variable]
../nginx_upload_module-2.2.0/ngx_http_upload_module.c: In function ‘ngx_http_upload_merge_ranges’:../nginx_upload_module-2.2.0/ngx_http_upload_module.c:1681:18: error: variable ‘result’ set but not used [-Werror=unused-but-set-variable]cc1: all warnings being treated as errorsmake[1]: *** [objs/addon/nginx_upload_module-2.2.0/ngx_http_upload_module.o] Error 1make[1]: Leaving directory `/root/build/nginx-1.0.10'make: *** [build] Error 2
解決:
Just replace "int result;" by "__attribute__((__unused__)) int result;".
分析:程式碼中有類似這樣的程式碼
int main()
{
int result;
if(...)
{result = func();
}
}
編譯器檢查嚴格,把所有的警告當做錯誤來對待。該警告產生的原因是由於 result有可能定義了但是用不到(if不會執行)
相關文章
- 錯誤解決:Attempting to use uninitialized value VariableZed
- Datastore error in 'dirbdb'錯誤解決ASTError
- PHP curl error 60 錯誤解決PHPError
- mysql:Variable 'character_set_client' can't be set to the value of 'NULL'解決MySqlclientNull
- Nginx的Upload上傳模組Nginx
- Variable 'character_set_client' can't be set to the value of Null的解決方法clientNull
- HTTP 錯誤 500.19- Internal Server Error 錯誤解決方法HTTPServerError
- db2 -attribute of key are miss in result set . db2 錯誤DB2
- HTTP 錯誤 500.21 - Internal Server Error 解決方案HTTPServerError
- TNS-04414 file error 錯誤解決Error
- Docker 容器中“TERM environment variable not set.”問題解決Docker
- nginx出現403錯誤的解決方法Nginx
- 安裝RAC,Actual Result: Unknown Host Exception has Occurred錯誤解決Exception
- 完美解決stack Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.ErrorPython
- [Modules/zlibmodule.o] Error 1錯誤解決IBMError
- (oracle Agent出現以下錯誤) Emd upload error:uploadXMLFiles skipp...OracleErrorXML
- Mysql:Variable 'XXXt' can't be set to the value of 'NULL'解決MySqlNull
- 解決問題:Variable 'time_zone' can't be set to the value of 'NULL'Null
- How to use sql result stored on shell variable?SQL
- nginx1.6 安裝上傳模組 nginx_upload_moduleNginx
- 解決:錯誤 1 error MSB8031: Building an MFC project for a non-Unicode character set is deprecatedErrorUIProjectUnicode
- SSL錯誤ssl connect error 35的解決方案Error
- 錯誤解決:cc: Internal error: Killed (program cc1)Error
- Myeclipse 錯誤An internal error has occurred 解決辦法EclipseError
- 解決錯誤:ASP.NET Error: Failed to access IIS metabaseASP.NETErrorAI
- Js錯誤Error物件詳解JSError物件
- Python中的UnboundLocalError: variable referenced before assignment錯誤分析與解決PythonError
- SAP CRM中介軟體錯誤IB_CRM_UPLOAD_MSG的解決方法
- nginx error_log 錯誤日誌配置說明NginxError
- 【Jenkins】data stream error|Error cloning remote repo ‘origin‘ 錯誤解決JenkinsErrorREM
- Nginx報504 gateway timeout錯誤的解決方法NginxGateway
- nginx FastCGI錯誤Primary script unknown解決辦法NginxAST
- Linux 7.0 報錯: Check if the DISPLAY variable is set. FailedLinuxAI
- 程式碼會引發 Notice: Undefined variable: undefined_variable 錯誤Undefined
- mysqldump error1066 錯誤的解決辦法MySqlError
- 解決 eslint 的 Parsing error: Unexpected token 錯誤EsLintError
- 織夢提示dedecms error warning錯誤的解決方法Error
- Nginx出現413 Request Entity Too Large錯誤解決方法Nginx