c++/2043: C++ traditional-cpp refuses to pass a specific pointer to function with void* argument

herter@pyramid.com herter@pyramid.com
Tue Feb 20 13:46:00 GMT 2001


>Number:         2043
>Category:       c++
>Synopsis:       C++ traditional-cpp refuses to pass a specific pointer to function with void* argument
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 20 13:46:03 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Herter
>Release:        2.95.2
>Organization:
>Environment:
Linux NN 2.2.16-SMP #1 SMP Wed Aug 2 20:01:21 GMT 2000 i686
>Description:
Even with -traditional-cpp can not translate code like this:



void sss(char *nn) { }
void vvv(void *nn) { }

main() 
{
        sss("HALLO");
        vvv("HALLO");
}

Legacy code has tens of thousands of such places in it, this
is the only compiler make and version known to me not
allowing this.

>How-To-Repeat:
NN> gcc -c -traditional-cpp t2.C
t2.C: In function `int main()':
t2.C:8: passing `const char *' as argument 1 of `vvv(void *)' discards qualifiers
>Fix:
None known except to edit all files and cast explicitely.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list