public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/113412] New: ATAN(Y,X) does not check arguments and generates wrong error message.
Date: Tue, 16 Jan 2024 02:13:13 +0000	[thread overview]
Message-ID: <bug-113412-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 113412
           Summary: ATAN(Y,X) does not check arguments and generates wrong
                    error message.
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kargl at gcc dot gnu.org
  Target Milestone: ---

Fortran 2008 added the misguided form ATAN(Y,X) where Y could be missing.
However, if Y is present, then X is required to have the same type and
kind as Y.

Consider,

% cat a.f90
program main
   real(4) x
   real(8) y
   x = 1.
   y = x
   print*, atan(y,x), atan2(y,x)
end


% gfcx -o z a.f90
a.f90:6:10:

    6 |    print*, atan(y,x), atan2(y,x)
      |          1
Error: Too many arguments in call to ‘atan’ at (1)
a.f90:6:30:

    6 |    print*, atan(y,x), atan2(y,x)
      |                              1
Error: ‘x’ argument of ‘atan2’ intrinsic at (1) must be the same type
and kind as ‘y’

The error message for atan(y,x) is wrong.

             reply	other threads:[~2024-01-16  2:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16  2:13 kargl at gcc dot gnu.org [this message]
2024-01-16  2:13 ` [Bug fortran/113412] " kargl at gcc dot gnu.org
2024-01-16 20:25 ` kargl at gcc dot gnu.org
2024-01-16 20:44 ` kargl at gcc dot gnu.org
2024-01-17  0:46 ` kargl at gcc dot gnu.org
2024-04-02 20:20 ` anlauf at gcc dot gnu.org
2024-04-02 22:15 ` kargls at comcast dot net
2024-04-03 20:12 ` anlauf at gcc dot gnu.org
2024-04-04  5:03 ` kargls at comcast dot net

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-113412-4@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).