git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Nick Alcock <nix@esperi.org.uk>,
	Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH na/strtoimax] Compatibility: declare strtoimax() under NO_STRTOUMAX
Date: Sun, 06 Nov 2011 18:21:30 +0000	[thread overview]
Message-ID: <4EB6D02A.4010000@ramsay1.demon.co.uk> (raw)
In-Reply-To: <4EB56593.6090402@kdbg.org>

Johannes Sixt wrote:
> Am 05.11.2011 16:37, schrieb Johannes Sixt:
>> Commit f696543d (Add strtoimax() compatibility function) introduced an
>> implementation of the function, but forgot to add a declaration.
> 
> On second thought, I'm puzzled: Without this patch and without noticing
> the warning that strtoimax() was not declared, I had built with
> NO_STRTOUMAX on MinGW before, and the build succeeded. This means that
> even though MinGW's headers are not C99, we must have pulled in function
> strtoimax() from somewhere. I'll investigate later this weekend.

Yes, I've noticed the same thing, viz:

    ramsay (pu)$ find /mingw/include -type f | xargs egrep 'strto(imax|umax|ull)'
    /mingw/include/inttypes.h:intmax_t __cdecl __MINGW_NOTHROW strtoimax (const char
    * __restrict__ nptr,
    /mingw/include/inttypes.h:uintmax_t __cdecl __MINGW_NOTHROW strtoumax (const cha
    r* __restrict__ nptr,
    /mingw/include/stdlib.h:unsigned long long  __cdecl __MINGW_NOTHROW strtoull (co
    nst char* __restrict__, char** __restrict__, int);

    ramsay (pu)$ nm /mingw/lib/libmingwex.a | egrep 'strto(imax|umax|ull)'
    strtoimax.o:
    00000000 T _strtoimax
    strtoumax.o:
    00000000 T _strtoull
    00000000 T _strtoumax

    ramsay (pu)$

So, I assume, an earlier version of MinGW did not have the inttypes.h header
file and the NO_STRTOUMAX etc. settings are stale; dunno ;-)

In any event, I guess an '#include <inttypes.h>' on MinGW will be part of the
solution. [Without breaking the MSVC build, of course; see the NO_INTTYPES_H
make variable.] However, I haven't given it too much thought, so take that with
a bucket of salt!

Note, also, that very similar comments apply to NO_LIBGEN_H; viz:

    ramsay (pu)$ find /mingw/include -type f | xargs egrep 'char \*(dir|base)name'
    /mingw/include/libgen.h:extern __cdecl __MINGW_NOTHROW char *basename (char *);
    /mingw/include/libgen.h:extern __cdecl __MINGW_NOTHROW char *dirname  (char *);

    ramsay (pu)$ nm /mingw/lib/libmingwex.a | egrep '(dir|base)name'
    basename.o:
    00000000 T _basename
    dirname.o:
    00000000 T _dirname

    ramsay (pu)$

[having said that, I have a patch that adds a compat/dirname.c and modifies
the existing compat/basename.c; the MinGW dirname()/basename() functions 
have problems.]

HTH

ATB,
Ramsay Jones

  reply	other threads:[~2011-11-06 18:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-05 15:37 [PATCH na/strtoimax] Compatibility: declare strtoimax() under NO_STRTOUMAX Johannes Sixt
2011-11-05 15:38 ` Nix
2011-11-05 16:34 ` Johannes Sixt
2011-11-06 18:21   ` Ramsay Jones [this message]
2011-11-06  6:10 ` Junio C Hamano
2011-11-06  8:53   ` Johannes Sixt

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=4EB6D02A.4010000@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1.demon.co.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=nix@esperi.org.uk \
    /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 NNTP newsgroup(s).