public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "terra at gnome dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/96570] Warnings desired for time_t to int coversions
Date: Wed, 12 Aug 2020 01:05:54 +0000	[thread overview]
Message-ID: <bug-96570-4-cyxR6XLiJI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96570-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from M Welinder <terra at gnome dot org> ---
> Explicit casts don't, and that's what I was questioning.

They most certainly do.  That's an empirical statement from having gone over a
fairly large code base.  It is not a statement that they should occur there and
there is likely nothing "inadvertent[ly]" about their presence.  "Mistaken" and
"ill-advised" are probably better descriptions, but the reasons have long since
been forgotten.  I.e., the code is buggy.

Look, you are being a bit defensive here which is strange as no-one is
attacking you.  Please try looking at the goal:

*** The goal here is to find time handling bugs.

Is that a worthy goal for gcc?

I will assert that there is a lot of buggy time handling code out there and
that fixing it will receive more and more attention over the next 15 years.

The compiler may or may not be the right tool to help find and fix these, but
gcc has in the past taken it upon itself to warn about other classes of
likely-wrong code and it is fairly well positioned to do so given its access to
a parse tree and type information.

  parent reply	other threads:[~2020-08-12  1:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 15:46 [Bug c++/96570] New: " terra at gnome dot org
2020-08-11 16:12 ` [Bug c++/96570] " redi at gcc dot gnu.org
2020-08-11 17:17 ` terra at gnome dot org
2020-08-11 17:26 ` redi at gcc dot gnu.org
2020-08-12  1:05 ` terra at gnome dot org [this message]
2020-08-12  7:12 ` redi at gcc dot gnu.org
2020-08-12 15:27 ` egallager 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-96570-4-cyxR6XLiJI@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).