All of lore.kernel.org
 help / color / mirror / Atom feed
* build error: strerror() ...
@ 2006-12-08 16:25 Gerd Hoffmann
  2006-12-08 16:36 ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Gerd Hoffmann @ 2006-12-08 16:25 UTC (permalink / raw)
  To: Xen devel list

  Hi,

changeset 12809 gives me this:

xc_private.c: In function ‘safe_strerror’:
xc_private.c:500: warning: return makes pointer from integer without a cast
make[3]: *** [xc_private.o] Error 1

cheers,
  Gerd

-- 
Gerd Hoffmann <kraxel@suse.de>

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

* Re: build error: strerror() ...
  2006-12-08 16:25 build error: strerror() Gerd Hoffmann
@ 2006-12-08 16:36 ` Keir Fraser
  2006-12-08 22:08   ` Daniel P. Berrange
  0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2006-12-08 16:36 UTC (permalink / raw)
  To: Gerd Hoffmann, Xen devel list


strerror_r() sucks. I removed it and used a pthread mutex instead.

 K.

On 8/12/06 16:25, "Gerd Hoffmann" <kraxel@suse.de> wrote:

>   Hi,
> 
> changeset 12809 gives me this:
> 
> xc_private.c: In function Œsafe_strerror¹:
> xc_private.c:500: warning: return makes pointer from integer without a cast
> make[3]: *** [xc_private.o] Error 1
> 
> cheers,
>   Gerd

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

* Re: build error: strerror() ...
  2006-12-08 16:36 ` Keir Fraser
@ 2006-12-08 22:08   ` Daniel P. Berrange
  2006-12-09  8:59     ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel P. Berrange @ 2006-12-08 22:08 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Gerd Hoffmann, Xen devel list

On Fri, Dec 08, 2006 at 04:36:24PM +0000, Keir Fraser wrote:
> 
> strerror_r() sucks. I removed it and used a pthread mutex instead.

If you  '#define _XOPEN_SOURCE 600'  then glibc will provide the standards
compliant version of strerror_r which always uses the user supplied buffer.
Seems simpler than rolling our own code using pthreads mutexes.

[quote strerror_r(3)]

       #define _XOPEN_SOURCE 600
       #include <string.h>

       int strerror_r(int errnum, char *buf, size_t buflen);
                               /* XSI-compliant strerror_r() */


      .....

       The  XSI-compliant  strerror_r() is preferred for portable applications.  It returns
       the error string in the user-supplied buffer buf of length buflen.
[/quote]
  
Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

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

* Re: build error: strerror() ...
  2006-12-08 22:08   ` Daniel P. Berrange
@ 2006-12-09  8:59     ` Keir Fraser
  0 siblings, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2006-12-09  8:59 UTC (permalink / raw)
  To: Daniel P. Berrange, Keir Fraser; +Cc: Gerd Hoffmann, Xen devel list

On 8/12/06 10:08 pm, "Daniel P. Berrange" <berrange@redhat.com> wrote:

>> strerror_r() sucks. I removed it and used a pthread mutex instead.
> 
> If you  '#define _XOPEN_SOURCE 600'  then glibc will provide the standards
> compliant version of strerror_r which always uses the user supplied buffer.
> Seems simpler than rolling our own code using pthreads mutexes.

My Debian build box defines only the GNU version.

It seems that strerror_r() is basically unusable unless you do a
'configure'-style compile test to set a build flag.

 -- Keir

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

end of thread, other threads:[~2006-12-09  8:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-08 16:25 build error: strerror() Gerd Hoffmann
2006-12-08 16:36 ` Keir Fraser
2006-12-08 22:08   ` Daniel P. Berrange
2006-12-09  8:59     ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.