public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Mark Wielaard <mark@klomp.org>
Cc: dwz@sourceware.org
Subject: Re: [PATCH] Mark and init shstrtab[_len] and const in optimize_multifile
Date: Thu, 30 Jun 2022 13:47:09 +0200	[thread overview]
Message-ID: <Yr2NPaeB1P3wgvuM@tucnak> (raw)
In-Reply-To: <20220630113455.30700-1-mark@klomp.org>

On Thu, Jun 30, 2022 at 01:34:55PM +0200, Mark Wielaard wrote:
> Old gcc (4.8.5) warn that shstrtab and shstrtab_len can be clobbered
> by the longjump. Work around that by marking shstrtab_gnu and
> shstrtab_dwarf5 as static and shstrtab and shstrtab_len as const.
> Init shstrtab and shstrtab_len at declaration.
> 
> 	* dwz.c (optimize_multifile): Make shstrtab_[gnu|dwarf5],
> 	shstrtab[_len] static. shstrtab[_len] init and make const.
> -  const char *shstrtab;
> -  size_t shstrtab_len;
> +  const char *shstrtab = dwarf_5 ? shstrtab_dwarf5 : shstrtab_gnu;

You aren't marking shstrtab as const though, that would be
  const char *const shstrtab = ...

Otherwise LGTM.

	Jakub


  reply	other threads:[~2022-06-30 11:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 11:34 Mark Wielaard
2022-06-30 11:47 ` Jakub Jelinek [this message]
2022-06-30 12:47   ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yr2NPaeB1P3wgvuM@tucnak \
    --to=jakub@redhat.com \
    --cc=dwz@sourceware.org \
    --cc=mark@klomp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).