public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: "Martin Liška" <mliska@suse.cz>, "Jakub Jelinek" <jakub@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, fortran <fortran@gcc.gnu.org>
Subject: [committed] fortran/dump-parse-tree.c: Use proper enum type (was: Re: [Patch ]Fortran/OpenMP: Extend defaultmap clause for OpenMP 5 [PR92568])
Date: Wed, 23 Jun 2021 22:15:27 +0200	[thread overview]
Message-ID: <8f5b5912-14c7-b104-39b0-f886412b1c3a@codesourcery.com> (raw)
In-Reply-To: <29cd1f01-c8f5-a10b-48bd-bc82810a26ee@suse.cz>

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

Indeed, I somehow managed to use the wrong of the two enums in the cast ...
Fixed in  r12-1760-gcac3527793b38164e2a83c7ccbfe0cfcf5ac95b8

On 23.06.21 16:13, Martin Liška wrote:

> I noticed the patch causes the following clang warnings:
> gcc/fortran/dump-parse-tree.c:1786:11: warning: comparison of
> different enumeration types in switch statement ('enum
> gfc_omp_defaultmap' and 'gfc_omp_defaultmap_category')
> [-Wenum-compare-switch]

Thanks for reporting!

Tobias


-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf

[-- Attachment #2: committed.diff --]
[-- Type: text/x-patch, Size: 921 bytes --]

commit cac3527793b38164e2a83c7ccbfe0cfcf5ac95b8
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Wed Jun 23 22:10:43 2021 +0200

    fortran/dump-parse-tree.c: Use proper enum type
    
    gcc/fortran/ChangeLog:
    
            * dump-parse-tree.c (show_omp_clauses): Fix enum type used
            for dumping gfc_omp_defaultmap_category.

diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c
index 07e98b7e30d..26841eefb7d 100644
--- a/gcc/fortran/dump-parse-tree.c
+++ b/gcc/fortran/dump-parse-tree.c
@@ -1781,7 +1781,7 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses)
       if (i != OMP_DEFAULTMAP_CAT_UNCATEGORIZED)
 	{
 	  fputc (':', dumpfile);
-	  switch ((enum gfc_omp_defaultmap) i)
+	  switch ((enum gfc_omp_defaultmap_category) i)
 	    {
 	    case OMP_DEFAULTMAP_CAT_SCALAR: dfltmap = "SCALAR"; break;
 	    case OMP_DEFAULTMAP_CAT_AGGREGATE: dfltmap = "AGGREGATE"; break;

      reply	other threads:[~2021-06-23 20:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 12:18 [Patch ]Fortran/OpenMP: Extend defaultmap clause for OpenMP 5 [PR92568] Tobias Burnus
2021-06-14 16:18 ` Jakub Jelinek
2021-06-15 13:45   ` Tobias Burnus
2021-06-15 14:01     ` Jakub Jelinek
2021-06-23 14:13     ` Martin Liška
2021-06-23 20:15       ` Tobias Burnus [this message]

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=8f5b5912-14c7-b104-39b0-f886412b1c3a@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=mliska@suse.cz \
    /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).