public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/marxin/heads/Wodr-fix-in-jit)] jit: Fix -Wodr warning
Date: Mon, 20 Dec 2021 10:34:26 +0000 (GMT)	[thread overview]
Message-ID: <20211220103426.7874D3857C66@sourceware.org> (raw)

https://gcc.gnu.org/g:1d90221d247f9a67a91ac29ce3c9ec2459c150eb

commit 1d90221d247f9a67a91ac29ce3c9ec2459c150eb
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Dec 20 11:31:50 2021 +0100

    jit: Fix -Wodr warning
    
    gcc/jit/libgccjit.c:3957:8: warning: type 'struct version_info' violates the C++ One Definition Rule [-Wodr]
    
    ../../gcc/jit/libgccjit.c:3957:8: warning: type 'struct version_info' violates the C++ One Definition Rule [-Wodr]
     3957 | struct version_info
    
    ../../gcc/tree-ssa-loop-ivopts.c:181: note: a different type is defined in another translation unit
      181 | struct version_info
    
    gcc/jit/ChangeLog:
    
            * libgccjit.c (struct version_info): Rename to jit_version_info.
            (struct jit_version_info): Likewise.
            (gcc_jit_version_major): Likewise.
            (gcc_jit_version_minor): Likewise.
            (gcc_jit_version_patchlevel): Likewise.

Diff:
---
 gcc/jit/libgccjit.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
index 5cb27a20d41..3d2d838dc4d 100644
--- a/gcc/jit/libgccjit.c
+++ b/gcc/jit/libgccjit.c
@@ -3954,11 +3954,11 @@ gcc_jit_context_new_rvalue_from_vector (gcc_jit_context *ctxt,
 
 static pthread_mutex_t version_mutex = PTHREAD_MUTEX_INITIALIZER;
 
-struct version_info
+struct jit_version_info
 {
   /* Default constructor.  Populate via parse_basever,
      guarded by version_mutex.  */
-  version_info ()
+  jit_version_info ()
   {
     pthread_mutex_lock (&version_mutex);
     parse_basever (&major, &minor, &patchlevel);
@@ -3974,21 +3974,21 @@ struct version_info
 extern int
 gcc_jit_version_major (void)
 {
-  version_info vi;
+  jit_version_info vi;
   return vi.major;
 }
 
 extern int
 gcc_jit_version_minor (void)
 {
-  version_info vi;
+  jit_version_info vi;
   return vi.minor;
 }
 
 extern int
 gcc_jit_version_patchlevel (void)
 {
-  version_info vi;
+  jit_version_info vi;
   return vi.patchlevel;
 }


                 reply	other threads:[~2021-12-20 10:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20211220103426.7874D3857C66@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@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).