public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/5503: GCC 3.0.3 ignores the prototype for fputs()
@ 2002-01-26 15:26 lukas
  0 siblings, 0 replies; only message in thread
From: lukas @ 2002-01-26 15:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5503
>Category:       c
>Synopsis:       GCC ignores prototype
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 26 15:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Lukas Mai
>Release:        3.0.3
>Organization:
>Environment:
System: Linux barubary 2.2.18 #1 Fri Jan 19 22:10:35 GMT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-3.0.3/configure --program-suffix=-3.0.3
>Description:
GCC 3.0.3 ignores the prototype for fputs(). It compiles a call with the wrong
number or type of arguments without any errors or warnings. The resulting
executable crashes (Segmentation fault).
>How-To-Repeat:
/* This program compiles without complaints using `gcc -W -Wall' */
int fputs(int, int, int);
int main(void) {
	fputs(42);
	return 0;
}
>Fix:
To work around this, you could use a wrapper function:
int wrap_fputs(const char *s, FILE *stream) {
	return fputs(s, stream);
}
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-26 23:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-26 15:26 c/5503: GCC 3.0.3 ignores the prototype for fputs() lukas

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 read-only IMAP folder(s) and NNTP newsgroup(s).