misc/156601: New dialog.h undefines ERR making curses macros unavailable

Stephen Hurd shurd at sasktel.net
Sat Apr 23 19:50:12 UTC 2011


>Number:         156601
>Category:       misc
>Synopsis:       New dialog.h undefines ERR making curses macros unavailable
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 23 19:50:12 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Stephen Hurd
>Release:        9.0-CURRENT
>Organization:
>Environment:
FreeBSD  9.0-CURRENT FreeBSD 9.0-CURRENT #1: Sat Apr 23 10:37:10 UTC 2011       root@:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
The new dialog.h on line 47 undefines the ERR macro with a comment of "header conflict with Solaris xpg4" this means that if n?curses.h is included before dialog.h, ERR becomes undefined and the various macros in curses.h (ie: getmaxy()) break.

Since our curses.h #undef's ERR itself, there is no need for this in FreeBSD, and since it requires specific #include ordering for no good reason, it should be removed.
>How-To-Repeat:
#include <curses.h>
#include <dialog.h>
#include <stdio.h>

int main(int argc, char **argv)
{
    initscr();
    fprintf(stderr, "%d\n", getmaxy(stdscr));
    endwin();
    return 0;
}

>Fix:
Remove line 47 of dialog.h for FreeBSD

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list