tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* small for FreeBSD
@ 2018-02-08 19:31 Brooks Davis
  2018-02-08 23:40 ` Jan Stary
  0 siblings, 1 reply; 4+ messages in thread
From: Brooks Davis @ 2018-02-08 19:31 UTC (permalink / raw)
  To: tech

[-- Attachment #1: Type: text/plain, Size: 968 bytes --]

In our local tree we have this change to work around the fact that
FreeBSD doesn't provide a getline() prototype unless _WITH_GETLINE is
defined before stdio.h is included.  It would be nice if some variant of
this could make it in to mandoc.

Thanks,
Brooks

commit f1e1737d27fe77dc6f7709aee31911e30684d653
Author: Robert N. M. Watson <robert.watson@cl.cam.ac.uk>
Date:   Wed Aug 16 22:58:19 2017 +0100

    getline(3) now requires defining _WITH_GETLINE before including stdio.h.
    Otherwise, getline() comes without function prototypes, which is not OK
    on CHERI.
    
    (Upstreaming candidate.)

diff --git a/contrib/mdocml/mandocdb.c b/contrib/mdocml/mandocdb.c
index b9e4fb1c813..4f064d88fde 100644
--- a/contrib/mdocml/mandocdb.c
+++ b/contrib/mdocml/mandocdb.c
@@ -40,6 +40,7 @@
 #endif
 #include <stdarg.h>
 #include <stddef.h>
+#define        _WITH_GETLINE
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

* Re: small for FreeBSD
  2018-02-08 19:31 small for FreeBSD Brooks Davis
@ 2018-02-08 23:40 ` Jan Stary
  2018-02-08 23:47   ` Brooks Davis
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Stary @ 2018-02-08 23:40 UTC (permalink / raw)
  To: tech

On Feb 08 19:31:46, brooks@freebsd.org wrote:
> In our local tree we have this change to work around the fact that
> FreeBSD doesn't provide a getline() prototype unless _WITH_GETLINE is
> defined before stdio.h is included.  It would be nice if some variant of
> this could make it in to mandoc.

It would be way nicer if FreeBSD just provided getline(), period.

--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv

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

* Re: small for FreeBSD
  2018-02-08 23:40 ` Jan Stary
@ 2018-02-08 23:47   ` Brooks Davis
  2018-02-09  0:54     ` Ingo Schwarze
  0 siblings, 1 reply; 4+ messages in thread
From: Brooks Davis @ 2018-02-08 23:47 UTC (permalink / raw)
  To: tech

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

On Fri, Feb 09, 2018 at 12:40:23AM +0100, Jan Stary wrote:
> On Feb 08 19:31:46, brooks@freebsd.org wrote:
> > In our local tree we have this change to work around the fact that
> > FreeBSD doesn't provide a getline() prototype unless _WITH_GETLINE is
> > defined before stdio.h is included.  It would be nice if some variant of
> > this could make it in to mandoc.
> 
> It would be way nicer if FreeBSD just provided getline(), period.

I apologize, it looks like the need for this was removed over a year go.
Please disregard.

Thanks,
Brooks

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

* Re: small for FreeBSD
  2018-02-08 23:47   ` Brooks Davis
@ 2018-02-09  0:54     ` Ingo Schwarze
  0 siblings, 0 replies; 4+ messages in thread
From: Ingo Schwarze @ 2018-02-09  0:54 UTC (permalink / raw)
  To: Brooks Davis; +Cc: tech

Hi Brooks,

Brooks Davis wrote on Thu, Feb 08, 2018 at 11:47:27PM +0000:
> On Fri, Feb 09, 2018 at 12:40:23AM +0100, Jan Stary wrote:
> > On Feb 08 19:31:46, brooks@freebsd.org wrote:

>>> In our local tree we have this change to work around the fact that
>>> FreeBSD doesn't provide a getline() prototype unless _WITH_GETLINE is
>>> defined before stdio.h is included.  It would be nice if some variant of
>>> this could make it in to mandoc.

>> It would be way nicer if FreeBSD just provided getline(), period.

> I apologize, it looks like the need for this was removed over a year go.
> Please disregard.

You mean,

  https://svnweb.freebsd.org/base/head/include/stdio.h?r1=299574&r2=303524

?

Yeah, i think bapt@ did the right thing there.  The getline(3)
function has been in POSIX for some time now, so it makes sense
to me that FreeBSD makes it available by default, too.

Old software that defined getline() to be something else should
adapt, and i guess most was changed by now, unless it has been
totally unmaintained for a decade.

So i think we agree that no change is needed in mandoc.

Yours,
  Ingo
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv

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

end of thread, other threads:[~2018-02-09  0:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08 19:31 small for FreeBSD Brooks Davis
2018-02-08 23:40 ` Jan Stary
2018-02-08 23:47   ` Brooks Davis
2018-02-09  0:54     ` Ingo Schwarze

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