buildroot.busybox.net archive mirror
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@buildroot.org
Subject: [Buildroot] [git commit branch/2022.11.x] package/uqmi: update patch for fix compile error (gcc false error reporting)
Date: Fri, 17 Mar 2023 09:35:00 +0100	[thread overview]
Message-ID: <20230317083633.26CFA874D2@busybox.osuosl.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 3981 bytes --]

commit: https://git.buildroot.net/buildroot/commit/?id=75693dbdd01a3a9fbb486b1603edee9e054ad640
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2022.11.x

Update the patch to to avoid gcc false error reporting (apply pragma ignored
only for gcc >= 12.x (as the warning '-Wdangling-pointer' was introduced
with gcc-12.x).

Fixes:

  - http://autobuild.buildroot.net/results/df380f921b74527b77290a658de0c57680083afa

  .../build/uqmi-0a19b5b77140465c29e2afa7d611fe93abc9672f/dev.c:213:32: error: unknown option after '#pragma GCC diagnostic' kind [-Werror=pragmas]
    213 | #pragma GCC diagnostic ignored "-Wdangling-pointer"
        |                                ^~~~~~~~~~~~~~~~~~~~

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit 6219046db6a434d549706e039f221c46464cee21)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 ...cc-12.x-false-error-reporting-storing-th.patch} | 23 ++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/package/uqmi/0001-uqmi-avoid-gcc-false-error-reporting-storing-the-add.patch b/package/uqmi/0001-uqmi-avoid-gcc-12.x-false-error-reporting-storing-th.patch
similarity index 71%
rename from package/uqmi/0001-uqmi-avoid-gcc-false-error-reporting-storing-the-add.patch
rename to package/uqmi/0001-uqmi-avoid-gcc-12.x-false-error-reporting-storing-th.patch
index c940925767..e2199228b9 100644
--- a/package/uqmi/0001-uqmi-avoid-gcc-false-error-reporting-storing-the-add.patch
+++ b/package/uqmi/0001-uqmi-avoid-gcc-12.x-false-error-reporting-storing-th.patch
@@ -1,10 +1,10 @@
-From 4c2eb926efb4de24af5a3b1e8c18195198827491 Mon Sep 17 00:00:00 2001
+From 63ab887be90c7fe37d537ea75e60eb95d6d87d3f Mon Sep 17 00:00:00 2001
 From: Peter Seiderer <ps.report@gmx.net>
 Date: Sun, 5 Mar 2023 22:08:13 +0100
-Subject: [PATCH] uqmi: avoid gcc false error reporting (storing the address of
- local variable 'complete' in '*req.complete')
+Subject: [PATCH] uqmi: avoid gcc-12.x false error reporting (storing the
+ address of local variable 'complete' in '*req.complete')
 
-Avoid gcc false error reporting (req->complete is later reset to NULL
+Avoid gcc-12.x false error reporting (req->complete is later reset to NULL
 in case of use of local complete):
 
   dev.c:217:23: error: storing the address of local variable 'complete' in '*req.complete' [-Werror=dangling-pointer=]
@@ -12,27 +12,30 @@ in case of use of local complete):
         |         ~~~~~~~~~~~~~~^~~~~~~~~~~
 
 Signed-off-by: Peter Seiderer <ps.report@gmx.net>
-
-[Upstream: http://lists.openwrt.org/pipermail/openwrt-devel/2023-March/040633.html]
+[Upstream: http://lists.openwrt.org/pipermail/openwrt-devel/2023-March/040667.html]
 Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+Changes v1 -> v2:
+  - apply pragma ignored only for gcc >= 12.x (as the warning
+    '-Wdangling-pointer' was introduced with gcc-12.x)
 ---
  dev.c | 12 ++++++++++++
  1 file changed, 12 insertions(+)
 
 diff --git a/dev.c b/dev.c
-index bd10207..b8ac273 100644
+index bd10207..dbd42d4 100644
 --- a/dev.c
 +++ b/dev.c
 @@ -203,6 +203,15 @@ void qmi_request_cancel(struct qmi_dev *qmi, struct qmi_request *req)
  	__qmi_request_complete(qmi, req, NULL);
  }
  
-+/* avoid gcc false error reporting:
++/* avoid gcc-12.x false error reporting:
 + *   dev.c:217:23: error: storing the address of local variable ‘complete’ in ‘*req.complete’ [-Werror=dangling-pointer=]
 + *     217 |         req->complete = &complete;
 + *         |         ~~~~~~~~~~~~~~^~~~~~~~~~~
 + */
-+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
++#if __GNUC__ >= 12
 +#pragma GCC diagnostic push
 +#pragma GCC diagnostic ignored "-Wdangling-pointer"
 +#endif
@@ -43,7 +46,7 @@ index bd10207..b8ac273 100644
  
  	return req->ret;
  }
-+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
++#if __GNUC__ >= 12
 +#pragma GCC diagnostic pop
 +#endif
  

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

                 reply	other threads:[~2023-03-17  8:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230317083633.26CFA874D2@busybox.osuosl.org \
    --to=peter@korsgaard.com \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).