On 14/03/2023 22:45, Bruno Haible wrote:
On macOS 12.5, I see compilation warnings:

../src/pr.c:1907:7: warning: variable 'total_lines_1' is used uninitialized 
whenever '||' condition is true [-Wsometimes-uninitialized]
../src/pr.c:1907:7: warning: variable 'chars_if_truncate' is used uninitialized 
whenever '||' condition is true [-Wsometimes-uninitialized]
../src/pr.c:1907:7: warning: variable 'chars_if_truncate' is used uninitialized 
whenever '||' condition is true [-Wsometimes-uninitialized]
../src/pr.c:1907:7: warning: variable 'chars_if_truncate' is used uninitialized 
whenever '||' condition is true [-Wsometimes-uninitialized]

and

../src/test.c:595:12: warning: variable 'value' is used uninitialized whenever 
'if' condition is false [-Wsometimes-uninitialized]
../src/test.c:595:12: warning: variable 'value' is used uninitialized whenever 
'&&' condition is false [-Wsometimes-uninitialized]
../src/test.c:595:12: warning: variable 'value' is used uninitialized whenever 
'&&' condition is false [-Wsometimes-uninitialized]

They go away with the attached patch.

ChangeLog entry:

2023-03-14  Bruno Haible  <br...@clisp.org>

        pr, test: Avoid some warning on macOS 12.
        * src/pr.c (integer_overflow): Mark as _Noreturn.
        * src/test.c (beyond): Mark as _Noreturn.

Pushed in your name at:
https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=f1ff02124

cheers,
Pádraig

Reply via email to