All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: linux-xfs@vger.kernel.org
Subject: [Bug 215851] New: gcc 12.0.1 LATEST: -Wdangling-pointer= triggers
Date: Mon, 18 Apr 2022 08:02:41 +0000	[thread overview]
Message-ID: <bug-215851-201763@https.bugzilla.kernel.org/> (raw)

https://bugzilla.kernel.org/show_bug.cgi?id=215851

            Bug ID: 215851
           Summary: gcc 12.0.1 LATEST: -Wdangling-pointer= triggers
           Product: File System
           Version: 2.5
    Kernel Version: 5.17.3
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: XFS
          Assignee: filesystem_xfs@kernel-bugs.kernel.org
          Reporter: Erich.Loew@outlook.com
        Regression: No

Date:    20220415
Kernel:  5.17.3
Compiler gcc.12.0.1
File:    linux-5.17.3/fs/xfs/libxfs/xfs_attr_remote.c
Line:    141
Issue:   Linux kernel compiling enables all warnings, this has consequnces:
         -Wdangling-pointer= triggers because assignment of an address pointing
         to something inside of the local stack 
         of a function/method is returned to the caller.
         Doing such things is tricky but legal, however gcc 12.0.1 complains
         deeply on this.
         Mitigation: disabling with pragmas temporarily inlined the compiler
         triggered advises.
Interesting: clang-15.0.0 does not complain.
Remark: this occurence is reprsentative; the compiler warns at many places

To go pass through the compilation I added "-Wno-stringop-overread
-Wno-dangling-pointer -Wno-address -Wno-array-bounds -Wno-stringop-truncatio"
to the Makefile root file of the kernel tree.

This is not the cleanest approach but it helps for time being.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

             reply	other threads:[~2022-04-18  8:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18  8:02 bugzilla-daemon [this message]
2022-04-20 23:50 ` [Bug 215851] New: gcc 12.0.1 LATEST: -Wdangling-pointer= triggers Dave Chinner
2022-04-20 23:50 ` [Bug 215851] " bugzilla-daemon
2023-02-15 14:05 ` bugzilla-daemon

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=bug-215851-201763@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=linux-xfs@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.