git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/4] Suppress "statement not reached" warnings under Sun Studio

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 21, 2011, 20:41 UTC
Message-ID
<7vk45pfyj6.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACBZZX4htZRQH+2xvoskwE7KoTz98Ox-3xQf0hyEbbFDYCZYHw@mail.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> That would make that warning go away, but I don't know if that changes
> the semantics of the code. I was aiming not to change any code, just
> to squash spurious warnings under Sun Studio.

Well, earlier we skipped "if it is NUL return 1 and otherwise make sure it is a directory separator" check and went directly into whatever happens after we see a directory separator. The patch causes the same without goto.

If the code is too complex to confuse not so bright compilers, it is likely to confuse no so bright humans as well, and rewriting the logic in a more straightforward way to help humans is independently a good thing.

I am not particularly interested in squashing spurious warnings, but if it falls out of a side effect of helping humans, I wouldn't object to it.

Previous: Ævar Arnfjörð Bjarmason
Message 8 of 8 in “Eliminate warnings under Sun Studio”
  1. 0/4 Eliminate warnings under Sun StudioÆvar Arnfjörð Bjarmason, Dec 21, 2011
  2. 1/4 Fix an enum assignment issue spotted by Sun StudioÆvar Arnfjörð Bjarmason, Dec 21, 2011
  3. 2/4 Fix a bitwise negation assignment issue spotted by Sun StudioÆvar Arnfjörð Bjarmason, Dec 21, 2011
  4. 3/4 Appease Sun Studio by renaming "tmpfile"Ævar Arnfjörð Bjarmason, Dec 21, 2011
  5. 4/4 Suppress "statement not reached" warnings under Sun StudioÆvar Arnfjörð Bjarmason, Dec 21, 2011
  6. Junio C HamanoDec 21, 2011
  7. Ævar Arnfjörð BjarmasonDec 21, 2011
  8. Junio C HamanoDec 21, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.