public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Andreas Jaeger <aj@suse.de>
To: gcc-gnats@gcc.gnu.org
Subject: c/3116: Bug with using oldstyle prototype declarations
Date: Mon, 11 Jun 2001 02:06:00 -0000	[thread overview]
Message-ID: <200106110856.f5B8unE29761@gee.suse.de> (raw)

>Number:         3116
>Category:       c
>Synopsis:       Bug with using oldstyle prototype declarations
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 11 02:06:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        3.1 20010610 (experimental) (also 3.0 20010609)
>Organization:
SuSE
>Environment:
System: Linux gee 2.2.19 #1 Mon Apr 30 20:46:41 GMT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /cvs/gcc/configure --prefix=/opt/gcc-3.1-devel --enable-shared --enable-threads=posix --with-gnu-as --with-gnu-ld --disable-nls --with-system-zlib --enable-languages=c,objc,c++,f77,java
>Description:
	Compile the appended code, you get:
gee:~/tmp:[0]$ /opt/gcc-3.1-devel/bin/gcc -Wall -c fgetws.c
fgetws.c: In function `fgetws':
fgetws.c:18: argument `fp' doesn't match prototype
fgetws.c:11: prototype declaration

>How-To-Repeat:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
struct _IO_FILE {
  int _flags;
};

typedef struct _IO_FILE __FILE;
typedef struct _IO_FILE _IO_FILE;
typedef long int wchar_t;

extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
			__FILE *__restrict __stream);
#if 1
wchar_t *
fgetws (buf, n, fp)
     wchar_t *buf;
     int n;
     _IO_FILE *fp;
{
  return (wchar_t *)0;
}
#else
wchar_t *
fgetws (wchar_t *buf,int n,  _IO_FILE * fp)
{
  return (wchar_t *)0;
}

#endif
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The other case (#if 0) works, only old style prototypes are broken.
This is a regression from gcc 2.95.3.


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


             reply	other threads:[~2001-06-11  2:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-11  2:06 Andreas Jaeger [this message]
2001-06-11  6:36 Joseph S. Myers
2001-06-11  6:48 jsm28

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200106110856.f5B8unE29761@gee.suse.de \
    --to=aj@suse.de \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).