]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
autotools: silence gcc warnings in libtool code
authorViktor Szakats <commit@vsz.me>
Sun, 5 Jan 2025 13:24:40 +0000 (14:24 +0100)
committerViktor Szakats <commit@vsz.me>
Sun, 5 Jan 2025 16:15:05 +0000 (17:15 +0100)
```
./.libs/lt-upload-pausing.c: In function 'lt_fatal':
./.libs/lt-upload-pausing.c:593:1: warning: function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn]
  593 | lt_fatal (const char *file, int line, const char *message, ...)
      | ^~~~~~~~
```
https://github.com/curl/curl/actions/runs/12611924141/job/35148104431?pr=15911#step:11:264

Ref: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsuggest-attribute_003d

Closes #15915

m4/curl-compilers.m4

index b3521f4be867d9bf184b730eb7bf1ba4362802cf..994eb9c5224598facd28f93fb638f4fcd591b6d8 100644 (file)
@@ -1044,6 +1044,12 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
             if test "$curl_cv_native_windows" = "yes"; then
               tmp_CFLAGS="$tmp_CFLAGS -Wno-pedantic-ms-format"
             fi
+            case $host_os in
+              cygwin*)
+                dnl Silence warning in 'lt_fatal' libtool function
+                tmp_CFLAGS="$tmp_CFLAGS -Wno-suggest-attribute=noreturn"
+                ;;
+            esac
           fi
           #
           dnl Only gcc 4.6 or later