Subject: standards/1819: putc and getc macros are incorrect
To: None <gnats-bugs@gnats.netbsd.org>
From: Peter Seebach <seebs@taniemarie>
List: netbsd-bugs
Date: 12/05/1995 22:22:26
>Number: 1819
>Category: standards
>Synopsis: bug in getc and putc macros
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: gnats-admin (GNATS administrator)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 6 20:35:04 1995
>Last-Modified:
>Originator: Peter Seebach
>Organization:
Usenet Fact Police (Undercover)
>Release: 1.1
>Environment:
System: NetBSD taniemarie 1.1 NetBSD 1.1 (SEEBS) #3: Tue Nov 28 18:59:30 CST 1995 seebs@taniemarie:/usr/src/sys/arch/amiga/compile/SEEBS amiga
>Description:
The putc and getc macros do not function correctly when the pointer
argument is of type (void *). They should, to properly behave like
functions with prototypes in scope.
>How-To-Repeat:
#include <stdio.h>
main () {
void *v;
v = stdin;
getc(v);
return 0;
}
>Fix:
Add casts to (FILE *) in <stdio.h>.
(Unfortunately, this will introduce a lack of warning for non-pointer
arguments.)
>Audit-Trail:
>Unformatted: