score gcc-8 warning fixes

Alan Modra amodra@gmail.com
Mon May 14 03:30:00 GMT 2018


On Sun, May 13, 2018 at 08:22:09PM -0400, Carlos O'Donell wrote:
> On 05/12/2018 03:02 AM, Alan Modra wrote:
> > Rather than just silencing the gcc-8 warnings, I decided to rewrite
> > the buffer handling in the two functions where gcc was warning.
> > The rest of the file could do with the same treatment.  We're not
> > supposed to have line length limits in the assembler.
> > 
> > 	* config/tc-score.c (s3_do_macro_bcmp): Don't use fixed size
> > 	buffers.
> > 	(s3_do_macro_bcmpz): Likewise.
> 
> +1
> 
> Where possible we fixup code in glibc to remove gcc-8 warnings where
> it's a clear win.
> 
> These two cases you fix here are relatively easy to clean up, the rest
> looks like quite a complicated refactoring, particularly when it comes
> to copying error messages based on input from a line etc. There would
> be quite a bit of work to clean it all up.

Yes, that's what I decided too.

> It seems to me like you'd
> want to delete s3_MAX_LITERAL_POOL_SIZE and fixup the fallout by
> dynamically allocating whatever you needed?

Yes, perhaps using an obstack for the memory.  I haven't analysed
anything to any detail but it's highly likely that a lot of the
string copying is not needed.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list