Debian Bug report logs - #889821
[gcc] gcc 7 and 8 error message on restrict-qualified parameter refers to wrong parameter

version graph

Package: gcc; Maintainer for gcc is Debian GCC Maintainers <[email protected]>; Source for gcc is src:gcc-defaults (PTS, buildd, popcon).

Reported by: Philipp Klaus Krause <[email protected]>

Date: Wed, 7 Feb 2018 13:06:01 UTC

Severity: normal

Found in version gcc-defaults/1.173d1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Debian GCC Maintainers <[email protected]>:
Bug#889821; Package gcc. (Wed, 07 Feb 2018 13:06:05 GMT) (full text, mbox, link).


Acknowledgement sent to Philipp Klaus Krause <[email protected]>:
New Bug report received and forwarded. Copy sent to Debian GCC Maintainers <[email protected]>. (Wed, 07 Feb 2018 13:06:05 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Philipp Klaus Krause <[email protected]>
To: [email protected]
Subject: [gcc] gcc 7 and 8 error message on restrict-qualified parameter refers to wrong parameter
Date: Wed, 7 Feb 2018 13:50:14 +0100
Package: gcc
Version: 4:7.2.0-1d1
Severity: normal

--- Please enter the report below this line. ---

When a function pointer is restrict-qualified, GCC gives an error
message. However, when thishappens in a parameter list, gcc incorrectly
reports the error at the first restrict-qualified parameter, even if the
problem is at a different restrict-qaulified parameter. I tried with
both gcc 7.2.0 and gcc 8.0.0 from Debian.

Code to reproduce:

struct cvu_huffman_state
{
	unsigned char (*input)(void);
};

void cvu_init_huffman(struct cvu_huffman_state *restrict state, unsigned
char(*restrict input)(void))
{
	state->input = input;
}

The error message "error: invalid use of ‘restrict’" will report the
error at the first parameter, even though the problem is at the second
parameter.

Philipop

--- System information. ---
Architecture: Kernel:       Linux 4.14.0-2-amd64

Debian Release: buster/sid
  500 unstable        ftp.de.debian.org   500 testing
ftp.de.debian.org     1 experimental    ftp.de.debian.org
--- Package information. ---
Depends            (Version) | Installed
============================-+-=================
cpp         (>= 4:7.2.0-1d1) | 4:7.2.0-1d1
gcc-7          (>= 7.2.0-1~) | 7.2.0-19


Recommends      (Version) | Installed
=========================-+-===========
libc6-dev                 | 2.26-4
 OR libc-dev              |

Suggests          (Version) | Installed
===========================-+-===========
gcc-multilib                | make                        | 4.1-9.1
manpages-dev                | 4.14-1
autoconf                    | 2.69-11
automake                    | 1:1.15.1-3
libtool                     | 2.4.6-2
flex                        | 2.6.1-1.3
bison                       | 2:3.0.4.dfsg-1+b1
gdb                         | 7.12-6+b1
gcc-doc                     | 5:7.2.0-1



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 16:31:34 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.