NetBSD Problem Report #895

From gnats  Wed Mar 22 10:38:29 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.10/8.6.10) with ESMTP id KAA06594 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Wed, 22 Mar 1995 10:38:28 -0800
Message-Id: <199503221739.JAA09141@chris.cygnus.com>
Date: Wed, 22 Mar 1995 09:39:58 -0800
From: "J.T. Conklin" <jtc@chris.cygnus.com>
Reply-To: jtc@chris.cygnus.com
To: gnats-bugs@NetBSD.ORG
Subject: fgets() not ANSI compliant, second arg should be an int.
X-Send-Pr-Version: 3.2

>Number:         895
>Category:       lib
>Synopsis:       fgets() not ANSI compliant, second arg should be an int.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 22 10:50:03 +0000 1995
>Closed-Date:    Tue Apr 11 17:42:19 +0000 1995
>Last-Modified:  
>Originator:     J.T. Conklin
>Release:        1.0
>Organization:
Cygnus Support
>Environment:
System: NetBSD chris.cygnus.com 1.0 NetBSD 1.0 (TESLA) #3: Wed Mar 15 20:21:56 PST 1995 grossman@chris.cygnus.com:/usr/src/sys/arch/i386/compile/TESLA i386


>Description:
The fgets() function is defined such that the second argument is a size_t,
rather than an int as ANSI specifies.

>How-To-Repeat:
Compile this code:
	#include <stdio.h>
	extern char *fgets(char *, int, FILE *);
>Fix:
fgets needs to be fixed...  It's not as easy as it would have been before 
the DEC Alpha port arrived, since sizeof(int) != sizeof(size_t) on that
platform.

I'm planning to fix this in libc's ivory_soap branch.  This PR is only to
remind me to update stdio.h at the same time.
>Release-Note:
>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: jtc
State-Changed-When: Tue Apr 11 17:42:19 1995
State-Changed-Why:
Fixed, Alpha's calling convention allowed us to make the change anyway.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.