This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/71378] A compilable file fails to compile when ASAN options are specified


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 !

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]