This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/85: Re: casting const aways shouldn't be an error even with -pedantic-errors



>Number:         85
>Category:       c
>Synopsis:       casting const aways shouldn't be an error even with -pedantic-errors
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 06 01:26:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     scott douglass <sdouglass@arm.com>
>Release:        2.95.2
>Organization:
>Environment:
>Description:
 Original-Message-Id: <4.2.2.20000306082844.00a8b540@mail1>
 Date: Mon, 06 Mar 2000 08:33:03 +0000

 My apologies: when I wrote '-Wconst-qual' I should have written '-Wcast-qual'.  Please let me try again:

 int *f(const int *p) { return (int*)p; } /* (errror) cast discards `const' from pointer target type */

 The proper command line is:
	  gcc -c -Wcast-qual -pedantic-errors bug.c

 I believe that the error should only be a warning even with '-pedantic-errors'.

 gcc -v produces:
 Reading specs from /eda/tools/gnu/tools/gcc-2.95.2/sunos5.7/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/specs
 gcc version 2.95.2 19991024 (release)

 Thanks.

>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]