bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gprofng/29338] Declaration conflict for basename


From: vladimir.mezentsev at oracle dot com
Subject: [Bug gprofng/29338] Declaration conflict for basename
Date: Wed, 13 Jul 2022 19:10:39 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=29338

--- Comment #8 from Vladimir Mezentsev <vladimir.mezentsev at oracle dot com> 
---
1. About gprofng/autom4te.cache:
 I just cloned git binutils-gdb
% clone https://sourceware.org/git/binutils-gdb.git  binutils-gdb.git
% cd binutils-gdb.git
% find . -name autom4te.cache -ls

There is no autom4te.cache in the newly cloned repository.

What do `git clean -fx --dry-run` and `git clean -fx --dry-run`
report in your repository ?



2. Matthias Klose reports:
$ grep HAVE_DECL_BASENAME -r builddir-single/gprofng
builddir-single/gprofng/config.log:#define HAVE_DECL_BASENAME 1
builddir-single/gprofng/config.status:D["HAVE_DECL_BASENAME"]=" 1"


% cat -n include/libiberty.h | head -120 | tail -20
   101  
   102  /* HAVE_DECL_* is a three-state macro: undefined, 0 or 1.  If it is
   103     undefined, we haven't run the autoconf check so provide the
   104     declaration without arguments.  If it is 0, we checked and failed
   105     to find the declaration so provide a fully prototyped one.  If it
   106     is 1, we found it so don't provide any declaration at all.  */
   107  #if !HAVE_DECL_BASENAME
   108  #if defined (__GNU_LIBRARY__ ) || defined (__linux__) \
   109   || defined (__FreeBSD__) || defined (__OpenBSD__) || defined
(__NetBSD__) \
   110   || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined
(__MINGW32__) \
   111   || defined (__DragonFly__) || defined (HAVE_DECL_BASENAME) 
   112  extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL
ATTRIBUTE_NONNULL(1);
   113  #else
   114  /* Do not allow basename to be used if there is no prototype seen.  We
   115     either need to use the above prototype or have one from
   116     autoconf which would result in HAVE_DECL_BASENAME being set.  */
   117  #define basename basename_cannot_be_used_without_a_prototype
   118  #endif
   119  #endif

We see lines 108-118 should be ignored.


% cat -n gprofng/src/CompCom.cc | head -25
     1  /* Copyright (C) 2021 Free Software Foundation, Inc.
     2     Contributed by Oracle.
     3  
     4     This file is part of GNU Binutils.
     5  
     6     This program is free software; you can redistribute it and/or modify
     7     it under the terms of the GNU General Public License as published by
     8     the Free Software Foundation; either version 3, or (at your option)
     9     any later version.
    10  
    11     This program is distributed in the hope that it will be useful,
    12     but WITHOUT ANY WARRANTY; without even the implied warranty of
    13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14     GNU General Public License for more details.
    15  
    16     You should have received a copy of the GNU General Public License
    17     along with this program; if not, write to the Free Software
    18     Foundation, 51 Franklin Street - Fifth Floor, Boston,
    19     MA 02110-1301, USA.  */
    20  
    21  #include "config.h"
    22  #include <stdio.h>
    23  #include <string.h>
    24  #include <stdlib.h>
    25  #include <locale.h>


Maybe your build is using the wrong config.h on line 21?
Perhaps your repository has a config.h, such as in gprofng/common/, include/ or
opcodes/.

What does `find . -name config.h -ls` report in your repository ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]