Thread overview
Concerning __FILE__ __FUNC__
Nov 22, 2001
ZaitcevE.V.
Nov 22, 2001
Rajiv Bhagwat
Nov 22, 2001
Walter
Nov 22, 2001
Walter
Nov 22, 2001
Jan Knepper
Nov 23, 2001
ZaitcevE.V.
Nov 22, 2001
Jan Knepper
Nov 23, 2001
ZaitcevE.V.
November 22, 2001
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
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
__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
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
"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
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
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
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
> >
> >
> >