Thread overview | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
November 22, 2001 Concerning __FILE__ __FUNC__ | ||||
---|---|---|---|---|
| ||||
Why at compilation of the following code:(sc test.cpp -mx -c -cpp) void kpdodebug(unsigned const char *, unsigned const char *, unsigned const char *); class efdat { private: char *dat; public: int rezbl; efdat() { kpdodebug(__FILE__, __FUNC__, __TIMESTAMP__); }; }; The mistake is given out: test.cpp(13) : Error: expression expected --- errorlevel 1 |
November 22, 2001 Re: Concerning __FILE__ __FUNC__ | ||||
---|---|---|---|---|
| ||||
Posted in reply to ZaitcevE.V. | A little testing shows that __FUNC__ is not defined for DMC. What is your reasoning for assuming so? (Does it work for any other compiler?) -Rajiv Bhagwat ZaitcevE.V. <Genior@km.ru> wrote in message news:9tibih$1as3$1@digitaldaemon.com... > Why at compilation of the following code:(sc test.cpp -mx -c -cpp) > > void > kpdodebug(unsigned const char *, unsigned const char *, unsigned const char > *); > > class efdat > { > private: > char *dat; > public: > int rezbl; > efdat() > { > kpdodebug(__FILE__, __FUNC__, __TIMESTAMP__); > }; > }; > > The mistake is given out: > test.cpp(13) : Error: expression expected > --- errorlevel 1 > > > > > |
November 22, 2001 Re: Concerning __FILE__ __FUNC__ | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rajiv Bhagwat | __FUNCTION__ is the one he's likely looking for. www.digitalmars.com/ctg/predefined.html "Rajiv Bhagwat" <dataflow@vsnl.com> wrote in message news:9tid72$1d54$1@digitaldaemon.com... > A little testing shows that __FUNC__ is not defined for DMC. What is your > reasoning for assuming so? (Does it work for any other compiler?) > -Rajiv Bhagwat > > ZaitcevE.V. <Genior@km.ru> wrote in message news:9tibih$1as3$1@digitaldaemon.com... > > Why at compilation of the following code:(sc test.cpp -mx -c -cpp) > > > > void > > kpdodebug(unsigned const char *, unsigned const char *, unsigned const > char > > *); > > > > class efdat > > { > > private: > > char *dat; > > public: > > int rezbl; > > efdat() > > { > > kpdodebug(__FILE__, __FUNC__, __TIMESTAMP__); > > }; > > }; > > > > The mistake is given out: > > test.cpp(13) : Error: expression expected > > --- errorlevel 1 > > > > > > > > > > > > |
November 22, 2001 Re: Concerning __FILE__ __FUNC__ | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Ignore that last post of mine (!). __FUNC__ is defined and should work. #include <stdio.h> void main() { printf("__FUNC__ = '%s'\n", __FUNC__); } prints: __FUNC__ = 'main' "Walter" <walter@digitalmars.com> wrote in message news:9tjfh0$2nmf$1@digitaldaemon.com... > __FUNCTION__ is the one he's likely looking for. > > www.digitalmars.com/ctg/predefined.html > > > > "Rajiv Bhagwat" <dataflow@vsnl.com> wrote in message news:9tid72$1d54$1@digitaldaemon.com... > > A little testing shows that __FUNC__ is not defined for DMC. What is your > > reasoning for assuming so? (Does it work for any other compiler?) > > -Rajiv Bhagwat > > > > ZaitcevE.V. <Genior@km.ru> wrote in message news:9tibih$1as3$1@digitaldaemon.com... > > > Why at compilation of the following code:(sc test.cpp -mx -c -cpp) > > > > > > void > > > kpdodebug(unsigned const char *, unsigned const char *, unsigned const > > char > > > *); > > > > > > class efdat > > > { > > > private: > > > char *dat; > > > public: > > > int rezbl; > > > efdat() > > > { > > > kpdodebug(__FILE__, __FUNC__, __TIMESTAMP__); > > > }; > > > }; > > > > > > The mistake is given out: > > > test.cpp(13) : Error: expression expected > > > --- errorlevel 1 > > > > > > > > > > > > > > > > > > > > > |
November 22, 2001 Re: Concerning __FILE__ __FUNC__ | ||||
---|---|---|---|---|
| ||||
Posted in reply to ZaitcevE.V. | "ZaitcevE.V." wrote: > Why at compilation of the following code:(sc test.cpp -mx -c -cpp) > > void > kpdodebug(unsigned const char *, unsigned const char *, unsigned const char > *); > > class efdat > { > private: > char *dat; > public: > int rezbl; > efdat() > { > kpdodebug(__FILE__, __FUNC__, __TIMESTAMP__); > }; I thing the ';' here is not supposed to be there isn't it??? > > }; > > The mistake is given out: > test.cpp(13) : Error: expression expected > --- errorlevel 1 As far as I know __FUNC__ works just fine... Jan |
November 22, 2001 Re: Concerning __FILE__ __FUNC__ | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote:
> Ignore that last post of mine (!). __FUNC__ is defined and should work.
You should be able to just 'cancel' them...
Jan
|
November 23, 2001 Re: Concerning __FILE__ __FUNC__ | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jan Knepper Attachments: | Jan Knepper <jan@smartsoft.cc> ïèøåò â ñîîáùåíèè:3BFD4AE5.22BBAC5E@smartsoft.cc... > "ZaitcevE.V." wrote: > > > Why at compilation of the following code:(sc test.cpp -mx -c -cpp) > > > > void > > kpdodebug(unsigned const char *, unsigned const char *, unsigned const char > > *); > > > > class efdat > > { > > private: > > char *dat; > > public: > > int rezbl; > > efdat() > > { > > kpdodebug(__FILE__, __FUNC__, __TIMESTAMP__); > > }; > > I thing the ';' here is not supposed to be there isn't it??? > > As far as I know __FUNC__ works just fine... > > Jan > > > Jan it is a typing error in the message. The mistake arises at use in the designer of a class. Can check up. |
November 23, 2001 Re: Concerning __FILE__ __FUNC__ | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | mr.Wolter, These macroconst I always use for debugging and all was good. The mistake has arisen at use them in the designer of a class (it(he) enough large). I use the compiler: Digital Mars Compiler Version 8.0B7n Walter <walter@digitalmars.com> ÐÉÛÅÔ × ÓÏÏÂÝÅÎÉÉ:9tji0g$2qs5$2@digitaldaemon.com... > Ignore that last post of mine (!). __FUNC__ is defined and should work. > > > #include <stdio.h> > > void main() > { > printf("__FUNC__ = '%s'\n", __FUNC__); > } > > prints: > > __FUNC__ = 'main' > > "Walter" <walter@digitalmars.com> wrote in message news:9tjfh0$2nmf$1@digitaldaemon.com... > > __FUNCTION__ is the one he's likely looking for. > > > > www.digitalmars.com/ctg/predefined.html > > > > > > |
Copyright © 1999-2021 by the D Language Foundation