This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71378] A compilable file fails to compile when ASAN options are specified
- From: "asankau at millenniumit dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 03 Jun 2016 10:41:23 +0000
- Subject: [Bug c++/71378] A compilable file fails to compile when ASAN options are specified
- Auto-submitted: auto-generated
- References: <bug-71378-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71378
--- Comment #7 from asankau at millenniumit dot com ---
(In reply to Martin LiÅka from comment #6)
> (In reply to asankau from comment #5)
> > (In reply to Martin LiÅka from comment #4)
> > > (In reply to asankau from comment #3)
> > > > Hi,
> > > > Is there a workaround to this problem ? (I mean is there anything that I can
> > > > do to the source code of FGConfig.cpp to get rid of this error.)
> > >
> > > You can workaround it by adding '--param asan-globals=0' to compile flags
> > > used for the source file.
> >
> > Thanks,
> >
> > Without disabling error detection for global objects (i.e. setting
> > asan-globals=0 ), is there a way to avoid this error by changing my source
> > code ?
> >
> > Sorry, I am not familiar with the internals of GCC. So I didn't understand
> > the root cause given by you.
> >
> > Wanted to know which section of my code triggered this error.
>
> > > Is there a workaround to this problem ? (I mean is there anything that I can
> > > do to the source code of FGConfig.cpp to get rid of this error.)
> >
> > You can workaround it by adding '--param asan-globals=0' to compile flags
> > used for the source file.
>
> Problem is that we emit a string constant with a not constant size, I'm
> preparing fix for that. It's caused by this snippet:
>
> void FGConfig::FillLoadPartitionInfo()
> {
> char zChannels[s_MDSPartIDStr.GetLen()+ 1] = "";
> ...
Thanks,
Changed the code to not to use Variable Size Stack Array, and now the code is
compilable !