[analyzer] Some built-in macros are 'Unknown' while others are well substituted

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[analyzer] Some built-in macros are 'Unknown' while others are well substituted

Hollman, Daisy Sophia via cfe-dev
It seems that the analyzer can not properly certain built-in macros.

void dump_builtin_macros() {
  clang_analyzer_dump(__LINE__); // 11 S32b
  clang_analyzer_dump(__FILE__); // &Element{"/home/myuser/builtin-macros.cpp",0 S64b,char}
  clang_analyzer_dump(__DATE__); // &Element{"Sep  1 2020",0 S64b,char}
  clang_analyzer_dump(__TIME__); // &Element{"19:40:54",0 S64b,char}
  clang_analyzer_dump(__COUNTER__); // 0 S32b
  clang_analyzer_dump(__func__); // Unknown
  clang_analyzer_dump(__PRETTY_FUNCTION__); // Unknown
}

As you can see `__func__` and `__PRETTY_FUNCTION__` macros are not modelled correctly.
I'm suspecting some misconfiguration of the preprocessor or something.
Do you know where should I have a look to fix this?

Balazs.

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [analyzer] Some built-in macros are 'Unknown' while others are well substituted

Hollman, Daisy Sophia via cfe-dev
(re-add the list)

On Wed, 2 Sep 2020 at 15:05, Pavel Labath <[hidden email]> wrote:

>
> I believe this is working as intended because __func__ and
> __PRETTY_FUNCTION__ are not macros (but slightly magical static
> variables). See
> <https://gcc.gnu.org/onlinedocs/gcc/Function-Names.html>.
>
> On Tue, 1 Sep 2020 at 19:47, Balázs Benics via cfe-dev
> <[hidden email]> wrote:
> >
> > It seems that the analyzer can not properly certain built-in macros.
> >
> > void dump_builtin_macros() {
> >   clang_analyzer_dump(__LINE__); // 11 S32b
> >   clang_analyzer_dump(__FILE__); // &Element{"/home/myuser/builtin-macros.cpp",0 S64b,char}
> >   clang_analyzer_dump(__DATE__); // &Element{"Sep  1 2020",0 S64b,char}
> >   clang_analyzer_dump(__TIME__); // &Element{"19:40:54",0 S64b,char}
> >   clang_analyzer_dump(__COUNTER__); // 0 S32b
> >   clang_analyzer_dump(__func__); // Unknown
> >   clang_analyzer_dump(__PRETTY_FUNCTION__); // Unknown
> > }
> >
> > As you can see `__func__` and `__PRETTY_FUNCTION__` macros are not modelled correctly.
> > I'm suspecting some misconfiguration of the preprocessor or something.
> > Do you know where should I have a look to fix this?
> >
> > Balazs.
> > _______________________________________________
> > cfe-dev mailing list
> > [hidden email]
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [analyzer] Some built-in macros are 'Unknown' while others are well substituted

Hollman, Daisy Sophia via cfe-dev
In the meanwhile, I figured it out :D
The patch is on the way: https://reviews.llvm.org/D87004

Thanks.

Pavel Labath <[hidden email]> ezt írta (időpont: 2020. szept. 2., Sze, 13:05):
(re-add the list)

On Wed, 2 Sep 2020 at 15:05, Pavel Labath <[hidden email]> wrote:
>
> I believe this is working as intended because __func__ and
> __PRETTY_FUNCTION__ are not macros (but slightly magical static
> variables). See
> <https://gcc.gnu.org/onlinedocs/gcc/Function-Names.html>.
>
> On Tue, 1 Sep 2020 at 19:47, Balázs Benics via cfe-dev
> <[hidden email]> wrote:
> >
> > It seems that the analyzer can not properly certain built-in macros.
> >
> > void dump_builtin_macros() {
> >   clang_analyzer_dump(__LINE__); // 11 S32b
> >   clang_analyzer_dump(__FILE__); // &Element{"/home/myuser/builtin-macros.cpp",0 S64b,char}
> >   clang_analyzer_dump(__DATE__); // &Element{"Sep  1 2020",0 S64b,char}
> >   clang_analyzer_dump(__TIME__); // &Element{"19:40:54",0 S64b,char}
> >   clang_analyzer_dump(__COUNTER__); // 0 S32b
> >   clang_analyzer_dump(__func__); // Unknown
> >   clang_analyzer_dump(__PRETTY_FUNCTION__); // Unknown
> > }
> >
> > As you can see `__func__` and `__PRETTY_FUNCTION__` macros are not modelled correctly.
> > I'm suspecting some misconfiguration of the preprocessor or something.
> > Do you know where should I have a look to fix this?
> >
> > Balazs.
> > _______________________________________________
> > cfe-dev mailing list
> > [hidden email]
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev