public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Question about another IA64 HP-UX build problem
@ 2005-05-05 18:58 Steve Ellcey
  2005-05-05 20:09 ` James E Wilson
  0 siblings, 1 reply; 9+ messages in thread
From: Steve Ellcey @ 2005-05-05 18:58 UTC (permalink / raw)
  To: binutils


OK, I thought I had found all the IA64 HP-UX build problems but I was
just building gas and not binutils.  When building binutils I ran into a
problem with src/binutils/strings.c, this code has:

#ifdef HAVE_GETC_UNLOCKED
          c = getc_unlocked (stream);
#else
          c = getc (stream);
#endif

Now, on HP-UX the macro HAVE_GETC_UNLOCKED is defined but I only see the
declaration when compiling with -D_REENTRENT.  This is off by default so
I get an 'implicit declaration' error.

My question is, why is this the only use of getc_unlocked in binutils?

I see other uses of getc in nlmheader.y, readelf.c, resrc.c, sysdump.c,
and windres.c, but none of them have this ifdef structure.  Is there
a reason for this?  It looks like GCC has a way to handle this and I
can probably fix it with the same mechanism but I first wanted to find
out if there is a reason for having getc_unlocked in the first place.
Is it a performance issue?

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Question about another IA64 HP-UX build problem
@ 2005-05-22  5:43 John David Anglin
  0 siblings, 0 replies; 9+ messages in thread
From: John David Anglin @ 2005-05-22  5:43 UTC (permalink / raw)
  To: binutils, sje

> On Thu, 5 May 2005, Steve Ellcey wrote:
> > Yes, I have built this on ia64-hpux before.  It always gave a warning
> > because it didn't see the declaration of getc_unlocked in stdio.h.  This
> > is because _REENTRENT is not defined and the HP-UX header file only
> > defines getc_unlocked when _REENTRENT is defined.

The same error occurs on hppa2.0w-hp-hpux11.11.  Adding -pthread to CFLAGS
will provide the define but that will also cause linking against libpthread.

The linux manpage advises not using the nonstandard unlocked variants:

CONFORMING TO
       The     four     functions     getc_unlocked(),     getchar_unlocked(),
       putc_unlocked(),  putchar_unlocked()  are  in POSIX.1.  The nonstandard
       *_unlocked() variants occur on a few Unix systems, and are available in
       recent glibc.  They should probably not be used.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-05-22  3:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-05 18:58 Question about another IA64 HP-UX build problem Steve Ellcey
2005-05-05 20:09 ` James E Wilson
2005-05-05 20:24   ` Steve Ellcey
2005-05-06 19:24     ` Hans-Peter Nilsson
2005-05-06 21:28       ` Steve Ellcey
2005-05-05 23:29   ` Steve Ellcey
2005-05-06  2:21     ` Daniel Jacobowitz
2005-05-06 15:50       ` Steve Ellcey
2005-05-22  5:43 John David Anglin

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).