Skip to content

25edbe888b generates build-time warning from utf8.c #22858

Closed
@jkeenan

Description

@jkeenan

A new build-time warning has begun to appear. Compiling an unthreaded build on Ubuntu Linux 24.04 LTS using gcc-13.3.0 as the compiler, I observe:

cc -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c99 -O2 -Wall -Werror=pointer-arith -Werror=vla -Wextra -Wno-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings -Wno-use-after-free utf8.c
utf8.c: In function ‘Perl_utf8_to_uv_msgs_helper_’:
utf8.c:2153:39: warning: ‘uv’ may be used uninitialized [-Wmaybe-uninitialized]
 2153 |                             message = Perl_form(aTHX_ surrogate_cp_format, uv);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
utf8.c:1603:8: note: ‘uv’ was declared here
 1603 |     UV uv;
      |        ^~

Bisection with Devel::Git::MultiBisect with the following invocation:

$ perl ~/bin/perl/warnings-transitions.pl \
        --git_checkout_dir="$GIT_WORKDIR/perl2" \
        --workdir="$HOMEDIR/learn/perl/multisect/testing/gcc" \
        --first=5ae25c7756bbd08831a5a3900da1d60b7ba2c19a  \
        --last=c38b0528658b064c1dfaac6ae7abf1445dc71302

... pointed to the following commit:

commit 25edbe888b0c1e4b668bb874584cb944d98c12d5
Author:     Karl Williamson <khw@cpan.org>
AuthorDate: Fri Nov 22 15:23:43 2024 -0700
Commit:     Karl Williamson <khw@cpan.org>
CommitDate: Wed Dec 4 05:47:20 2024 -0700

    utf8_to_uv_msgs: Move premature setting to later

@khwilliamson, can you take a look? Thank you very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions