9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] vx32 @ FreeBSD: 9vx/a/chan.c:1220: error: conflicting types for 'memrchr'
@ 2008-07-10 15:32 Nikolai Saoukh
  2008-07-10 16:51 ` Martin Neubauer
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolai Saoukh @ 2008-07-10 15:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

$ uname -a
FreeBSD NetFaker 7.0-STABLE FreeBSD 7.0-STABLE #13: Wed Jul  2
15:04:57 MSD 2008     nms@NetFaker:/usr/obj/usr/src/sys/NETFAKER  i386
$ gmake
gcc -g -O3 -MD -std=gnu99 -I.  -I. -I9vx -I9vx/a -Wall
-Wno-missing-braces -c -o 9vx/a/chan.o 9vx/a/chan.c
9vx/a/chan.c:1220: error: conflicting types for 'memrchr'
/usr/include/string.h:62: error: previous declaration of 'memrchr' was
here {void    *memrchr(const void *, int, size_t) __pure;}



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

* Re: [9fans] vx32 @ FreeBSD: 9vx/a/chan.c:1220: error: conflicting types for 'memrchr'
  2008-07-10 15:32 [9fans] vx32 @ FreeBSD: 9vx/a/chan.c:1220: error: conflicting types for 'memrchr' Nikolai Saoukh
@ 2008-07-10 16:51 ` Martin Neubauer
  2008-07-11 14:58   ` Nikolai Saoukh
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Neubauer @ 2008-07-10 16:51 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

FreeBSD added memrchr to its libc a couple of weeks ago. The system one uses
size_t for the len argument; the 9vx one long. Changing that to unsigned
long probably would make the compiler happy but would most likely choke the
linker up. I chickened out and just commented out the definition in chan.c.
Another approach could be to rename memrchr to memrchr9 or the like. By the
way, drawterm and inferno are affected by that, too.

I hope that gets you going,
	MArtin

* Nikolai Saoukh (nms+9fans@otdel-1.org) wrote:
> $ uname -a
> FreeBSD NetFaker 7.0-STABLE FreeBSD 7.0-STABLE #13: Wed Jul  2
> 15:04:57 MSD 2008     nms@NetFaker:/usr/obj/usr/src/sys/NETFAKER  i386
> $ gmake
> gcc -g -O3 -MD -std=gnu99 -I.  -I. -I9vx -I9vx/a -Wall
> -Wno-missing-braces -c -o 9vx/a/chan.o 9vx/a/chan.c
> 9vx/a/chan.c:1220: error: conflicting types for 'memrchr'
> /usr/include/string.h:62: error: previous declaration of 'memrchr' was
> here {void    *memrchr(const void *, int, size_t) __pure;}



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

* Re: [9fans] vx32 @ FreeBSD: 9vx/a/chan.c:1220: error: conflicting types for 'memrchr'
  2008-07-10 16:51 ` Martin Neubauer
@ 2008-07-11 14:58   ` Nikolai Saoukh
  2008-07-11 15:24     ` Martin Neubauer
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolai Saoukh @ 2008-07-11 14:58 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> FreeBSD added memrchr to its libc a couple of weeks ago. The system one uses
> size_t for the len argument; the 9vx one long. Changing that to unsigned
> long probably would make the compiler happy but would most likely choke the
> linker up. I chickened out and just commented out the definition in chan.c.
> Another approach could be to rename memrchr to memrchr9 or the like. By the
> way, drawterm and inferno are affected by that, too.

This function is used exactly one time in the same file (~30 lines
below). What kind (version) of OS does not have memrchr?



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

* Re: [9fans] vx32 @ FreeBSD: 9vx/a/chan.c:1220: error: conflicting types for 'memrchr'
  2008-07-11 14:58   ` Nikolai Saoukh
@ 2008-07-11 15:24     ` Martin Neubauer
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Neubauer @ 2008-07-11 15:24 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Speaking of FreeBSD, I'd guess that all versions up to 7.0-RELEASE (and some
time beyond) don't have it. As the surrounding code seems to be more or less
shared with drawterm and inferno that could make for a large share of the
user base (on FreeBSD.) Therefore I think the rename would be the cleanest
solution. In some way that reminds me of the situation described in ``#ifdef
considered harmful.''

* Nikolai Saoukh (nms+9fans@otdel-1.org) wrote:
> This function is used exactly one time in the same file (~30 lines
> below). What kind (version) of OS does not have memrchr?



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

end of thread, other threads:[~2008-07-11 15:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-10 15:32 [9fans] vx32 @ FreeBSD: 9vx/a/chan.c:1220: error: conflicting types for 'memrchr' Nikolai Saoukh
2008-07-10 16:51 ` Martin Neubauer
2008-07-11 14:58   ` Nikolai Saoukh
2008-07-11 15:24     ` Martin Neubauer

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