Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 343123 - sys-libs/suacomp-0.6.5 fails to compile on strtoll.c and strtoull.c
Summary: sys-libs/suacomp-0.6.5 fails to compile on strtoll.c and strtoull.c
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Interix
: High normal (vote)
Assignee: Markus Duft (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-28 17:44 UTC by Sin Li
Modified: 2012-06-19 06:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sin Li 2010-10-28 17:44:00 UTC
The error:
CC   [shared] strtoll.c
/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/strtoll.c:12: error: expected declaration specifiers or '...' before '(' token
/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/strtoll.c:12: error: expected declaration specifiers or '...' before '(' token
/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/strtoll.c:12: error: expected declaration specifiers or '...' before '(' token
/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/strtoll.c: In function 'strtoq':
/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/strtoll.c:12: error: number of arguments doesn't match prototype
/usr/include/stdlib.h:127: error: prototype declaration
/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/strtoll.c:16: error: 'nptr' undeclared (first use in this function)
/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/strtoll.c:16: error: (Each undeclared identifier is reported only once
/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/strtoll.c:16: error: for each function it appears in.)
/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/strtoll.c:16: error: 'endptr' undeclared (first use in this function)
/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/strtoll.c:16: error: 'base' undeclared (first use in this function)
make: *** [/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/.build/strtoll.o] Error 1

The problem:
A patch from SUA puts the following in stdlib.h:
/* pkg_add :: strtoq patch start */
/* Yes, "quad" so to be used by gcc and c89/cc/MSVC */
extern quad_t __cdecl atoll(const char *, char **, int);
extern quad_t __cdecl strtoll(const char *, char **, int);
extern u_quad_t __cdecl strtoull(const char *, char **, int);
#define atoll(p) strtoq(p, NULL, 10)
#define strtoll(a, b, c) strtoq((a), (b), (c))
#define strtoull(a, b, c) strtouq((a), (b), (c))
/* pkg_add :: strtoq patch end */

The solution:
Add #ifndef strtoll and #ifndef strtoull guards around strtoll.c and strtoull.c.

Reproducible: Always
Comment 1 Sin Li 2010-10-28 17:57:41 UTC
Another problem:

/opt/gentoo/var/tmp/portage/sys-libs/suacomp-0.6.5/work/suacomp-0.6.5/getpwnam_r.c:11: error: conflicting types for 'getpwnam_r'
/usr/include/pwd.h:58: error: previous declaration of 'getpwnam_r' was here

getpwnam_r is in pwd.h as
int _CRTAPI1 getpwnam_r(const char *name, struct passwd *pwd,  char *buffer, size_t bufsize, struct passwd **result);

Comment 2 Markus Duft (RETIRED) gentoo-dev 2010-10-29 15:46:48 UTC
which interix version are you on?

as for the first thing (strtoll, etc), i am assuming an unpatched host system, as i cannot support all different kinds of "i fixed this myself already" kind of things. generally, modifying system headers/libraries is not a good idea.

i know interopsystems is doing this, as they seem to think they're allowed to, but... i don't think it's good practice whatsoever.
Comment 3 Sin Li 2010-10-29 16:48:37 UTC
I'm on 6.1-genuineintel.

I agree you shouldn't have to support random patches but I think these things are going to keep coming up, since interopsystems is as close to an official source as interix has, and most people will have these patches installed.
Comment 4 Pacho Ramos gentoo-dev 2012-06-16 08:32:16 UTC
Still valid with 0.6.14?
Comment 5 Markus Duft (RETIRED) gentoo-dev 2012-06-19 06:47:04 UTC
nope :) i'm still assuming unpatched host systems and cannot support patched ones, as of course, modifying system headers could make compilations fail - as always...