public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tschwinge at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/109289] Conflicting types for built-in functions in libgcc/emutls.c
Date: Fri, 01 Dec 2023 09:53:10 +0000	[thread overview]
Message-ID: <bug-109289-4-iIwmRDgwwn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109289-4@http.gcc.gnu.org/bugzilla/>

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

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-12-01
                 CC|                            |ams at gcc dot gnu.org,
                   |                            |fw at gcc dot gnu.org,
                   |                            |jules at gcc dot gnu.org,
                   |                            |tschwinge at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Similarly seen for GCN target, and this is now fatal after Florian's recent
changes (I presume -- and I fully do support those, for avoidance of doubt):

    [...]/source-gcc/libgcc/emutls.c:61:7: warning: conflicting types for
built-in function ‘__emutls_get_address’; expected ‘void *(void *)’
[-Wbuiltin-declaration-mismatch]
       61 | void *__emutls_get_address (struct __emutls_object *);
          |       ^~~~~~~~~~~~~~~~~~~~
    [...]/source-gcc/libgcc/emutls.c:63:6: warning: conflicting types for
built-in function ‘__emutls_register_common’; expected ‘void(void *, unsigned
int,  unsigned int,  void *)’ [-Wbuiltin-declaration-mismatch]
       63 | void __emutls_register_common (struct __emutls_object *, word,
word, void *);
          |      ^~~~~~~~~~~~~~~~~~~~~~~~
    [...]/source-gcc/libgcc/emutls.c:140:1: warning: conflicting types for
built-in function ‘__emutls_get_address’; expected ‘void *(void *)’
[-Wbuiltin-declaration-mismatch]
      140 | __emutls_get_address (struct __emutls_object *obj)
          | ^~~~~~~~~~~~~~~~~~~~
    [...]/source-gcc/libgcc/emutls.c: In function ‘__emutls_get_address’:
    [...]/source-gcc/libgcc/emutls.c:172:13: error: implicit declaration of
function ‘calloc’ [-Wimplicit-function-declaration]
      172 |       arr = calloc (size + 1, sizeof (void *));
          |             ^~~~~~
    [...]/source-gcc/libgcc/emutls.c:32:1: note: include ‘<stdlib.h>’ or
provide a declaration of ‘calloc’
       31 | #include "gthr.h"
      +++ |+#include <stdlib.h>
       32 |
    [...]/source-gcc/libgcc/emutls.c:172:13: warning: incompatible implicit
declaration of built-in function ‘calloc’ [-Wbuiltin-declaration-mismatch]
      172 |       arr = calloc (size + 1, sizeof (void *));
          |             ^~~~~~
    [...]/source-gcc/libgcc/emutls.c:172:13: note: include ‘<stdlib.h>’ or
provide a declaration of ‘calloc’
    [...]/source-gcc/libgcc/emutls.c:184:13: error: implicit declaration of
function ‘realloc’ [-Wimplicit-function-declaration]
      184 |       arr = realloc (arr, (size + 1) * sizeof (void *));
          |             ^~~~~~~
    [...]/source-gcc/libgcc/emutls.c:184:13: note: include ‘<stdlib.h>’ or
provide a declaration of ‘realloc’
    [...]/source-gcc/libgcc/emutls.c:184:13: warning: incompatible implicit
declaration of built-in function ‘realloc’ [-Wbuiltin-declaration-mismatch]
    [...]/source-gcc/libgcc/emutls.c:184:13: note: include ‘<stdlib.h>’ or
provide a declaration of ‘realloc’
    [...]/source-gcc/libgcc/emutls.c: At top level:
    [...]/source-gcc/libgcc/emutls.c:204:1: warning: conflicting types for
built-in function ‘__emutls_register_common’; expected ‘void(void *, unsigned
int,  unsigned int,  void *)’ [-Wbuiltin-declaration-mismatch]
      204 | __emutls_register_common (struct __emutls_object *obj,
          | ^~~~~~~~~~~~~~~~~~~~~~~~
    make[2]: *** [[...]/source-gcc/libgcc/static-object.mk:17: emutls.o] Error
1

GCC's suggestion to "include ‘<stdlib.h>’" needs to be carefully reviewed, in
case this is meant to be buildable in an environment without C library headers?

  parent reply	other threads:[~2023-12-01  9:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 22:58 [Bug libgcc/109289] New: " jdx at o2 dot pl
2023-03-27  0:14 ` [Bug libgcc/109289] " pinskia at gcc dot gnu.org
2023-12-01  9:53 ` tschwinge at gcc dot gnu.org [this message]
2023-12-01 10:17 ` fw at gcc dot gnu.org
2023-12-02 12:24 ` fw at gcc dot gnu.org
2023-12-02 23:00 ` pinskia at gcc dot gnu.org
2023-12-03  4:09 ` jdx at o2 dot pl
2023-12-05 16:41 ` tschwinge at gcc dot gnu.org
2023-12-06 11:03 ` tschwinge at gcc dot gnu.org
2023-12-06 11:27 ` cvs-commit at gcc dot gnu.org
2023-12-06 12:53 ` tschwinge 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-109289-4-iIwmRDgwwn@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).