mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jeeyong Um <conr2d@gmail.com>
To: musl@lists.openwall.com
Subject: build fail with message "error: redefinition of 'index' as different kind of symbol"
Date: Wed, 31 Jul 2019 00:31:17 +0900	[thread overview]
Message-ID: <CAFa4zD2iG7zvGNt+3M6amMqLivkiJFtrLTFzFN-9VTKVXv65tg@mail.gmail.com> (raw)

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

Hello.
I have a question about building musl with `_BSD_SOURCE` definition.

`src/time/__tz.c` has static variable named by `index` (line 25) and
include `string.h` header file (line 5).
5  #include <string.h>
25 static const unsigned char *zi, *trans, *index, *types, *abbrevs,
*abbrevs_end;

By the way, `include/string.h` includes `strings.h` when _BSD_SOURCE is
defined (line 57).
56 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
57 #include <strings.h>
58 #endif

`include/strings.h` has a function named by `index` too (line 19).
13 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) ||
defined(_POSIX_SOURCE) \
14  || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE+0 < 200809L) \
15  || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
16 int bcmp (const void *, const void *, size_t);
17 void bcopy (const void *, void *, size_t);
18 void bzero (void *, size_t);
19 char *index (const char *, int);
20 char *rindex (const char *, int);
21 #endif

Is it possible to build musl with _BSD_SOURCE definition in this case?
Even though `static` modifier limits the scope of variable to the file, the
conflict between `index` of `strings.h` and `index` of `__tz.c` seems
unavoidable.
Please let me know if you find any mistakes here.

Regards,
Jeeyong Um

[-- Attachment #2: Type: text/html, Size: 1784 bytes --]

             reply	other threads:[~2019-07-30 15:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 15:31 Jeeyong Um [this message]
2019-07-30 15:50 ` Rich Felker
2019-07-30 16:09   ` Jeeyong Um
2019-07-30 16:11     ` Rich Felker

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=CAFa4zD2iG7zvGNt+3M6amMqLivkiJFtrLTFzFN-9VTKVXv65tg@mail.gmail.com \
    --to=conr2d@gmail.com \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).