public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/113341] Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC
Date: Sun, 23 Jun 2024 16:47:22 +0000	[thread overview]
Message-ID: <bug-113341-4-IkYvRlmCeZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113341-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

--- Comment #14 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> This code gives me strict aliasing violation vibes:
> ```
> T **getAddressOfPointer(ExternalASTSource *Source) const {
>     // Ensure the integer is in pointer form.
>     (void)get(Source);
>     return reinterpret_cast<T**>(&Ptr);
>   }
> ```

A cast to void like that gives me very strong vibes, too, but of a "does this
person know C at all" kind.

Explicit casts are exceptionally useful, but they should be the exception.
They *should* stand out as something not normal.  Redundant useless silly casts
like this make code less readable, less clear.

Function results like this are implicitly ignored anyway.  Casting it to void
so it cannot be used is just silly, and that is a nice way of saying it.

</rant>

  parent reply	other threads:[~2024-06-23 16:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-11 22:07 [Bug target/113341] New: " glaubitz at physik dot fu-berlin.de
2024-01-11 22:13 ` [Bug target/113341] " pinskia at gcc dot gnu.org
2024-01-11 22:14 ` segher at gcc dot gnu.org
2024-01-11 22:18 ` glaubitz at physik dot fu-berlin.de
2024-01-11 22:18 ` pinskia at gcc dot gnu.org
2024-01-11 22:28 ` segher at gcc dot gnu.org
2024-01-11 22:32 ` pinskia at gcc dot gnu.org
2024-01-11 22:38 ` pinskia at gcc dot gnu.org
2024-01-11 22:42 ` jrtc27 at jrtc27 dot com
2024-01-12  8:04 ` linkw at gcc dot gnu.org
2024-06-14 20:29 ` glaubitz at physik dot fu-berlin.de
2024-06-15 12:46 ` glaubitz at physik dot fu-berlin.de
2024-06-15 13:38 ` xry111 at gcc dot gnu.org
2024-06-15 13:44 ` glaubitz at physik dot fu-berlin.de
2024-06-23 16:47 ` segher at gcc dot gnu.org [this message]
2024-06-23 16:55 ` segher at gcc dot gnu.org

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-113341-4-IkYvRlmCeZ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).