Thread overview | |||||
---|---|---|---|---|---|
|
September 27, 2004 const char* const* problem | ||||
---|---|---|---|---|
| ||||
Hello, i have strange problem with overloading function that accept const char* const* and char* const* arguments. Here is sample: void func(const char* const* D) { printf("%s\n", D[0]); } void func(char* const *D) { func((const char* const*)D); } int main() { char * D[]={"bla", "bla2"}; func(D); return 0; } When i try to compile it i got : func((const char* const*)D); ^ const.cpp(13) : Error: ambiguous reference to symbol Had: func(char const *const *) and: func(char *const *) func(D); ^ const.cpp(19) : Error: ambiguous reference to symbol Had: func(char const *const *) and: func(char *const *) --- errorlevel 1 Hm, strange; but when i place: void func(char* const D[]) or void func(const char* const D[]) compilation pass. It seems that compiler can't distiguish bettwen const char* const* and char* const* types. Other compilers (gcc, vc, borlandc++) support this. I tested with 8.38 and 8.41 Solutions (except casting) ? Thanks. Sanel |
September 28, 2004 Re: const char* const* problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sanel | Sanel <Sanel_member@pathlink.com> wrote:
> Hello,
> i have strange problem with overloading function that accept const char* const*
> and char* const* arguments. Here is sample:
Known bug, reported bug, awaiting fix (except mine is with void, not char).
-scooter
|
September 29, 2004 Re: const char* const* problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Scott Michel | Thanks. Hope fix come soon. Sanel In article <cjcork$306p$1@digitaldaemon.com>, Scott Michel says... > >Sanel <Sanel_member@pathlink.com> wrote: >> Hello, >> i have strange problem with overloading function that accept const char* const* >> and char* const* arguments. Here is sample: > >Known bug, reported bug, awaiting fix (except mine is with void, not char). > > >-scooter |
Copyright © 1999-2021 by the D Language Foundation