Project

General

Profile

Bug #6856

sys/stream.h exposes unnecessary macros to userland

Added by Lauri Tirkkonen almost 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Start date:
2016-04-06
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

In particular the message type macros with the naming convention M_<foo> break compilation of mutt-1.6.0 (and probably introduce subtle bugs in earlier versions). These macros don't seem to be useful outside the kernel; if they aren't, they should not be exposed to apps.

mutt breaks because it uses M_READ in an enum definition, similar to this sample program:

#include <sys/socket.h>
enum foo { M_FOO, M_READ, };
int main(void) { return 0; }
% gcc -o m_enum m_enum.c
In file included from /usr/include/netinet/in.h:67:0,
                 from /usr/include/sys/socket.h:53,
                 from m_enum.c:1:
m_enum.c:2:19: error: expected identifier before numeric constant
 enum foo { M_FOO, M_READ, };
                   ^

History

#2

Updated by Lauri Tirkkonen almost 4 years ago

Marcel Telka wrote:

FYI: To workaround the problem with the mutt 1.6.0 compilation you can use this:

https://raw.githubusercontent.com/OpenIndiana/oi-userland/103aae3bba2c4ff326801dfd450c9f7d1c1f1c83/components/mail/mutt/patches/stream-clash.patch

Thanks, I already had my own workaround in place.

#3

Updated by Electric Monk over 2 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 336970851eecf9c4348b3de7bbea0687059dd216

commit  336970851eecf9c4348b3de7bbea0687059dd216
Author: Gordon Ross <gwr@nexenta.com>
Date:   2017-06-12T21:37:36.000Z

    6856 sys/stream.h exposes unnecessary macros to userland
    Portions contributed by: Lauri Tirkkonen <lotheac@iki.fi>
    Reviewed by: Yuri Pankov <yuripv@gmx.com>
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>

Also available in: Atom PDF