tlf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anyone else compiling with GCC 10.2 on Debian Testing?


From: Nate Bargmann
Subject: Re: Anyone else compiling with GCC 10.2 on Debian Testing?
Date: Fri, 22 Jan 2021 08:42:24 -0600

* On 2021 22 Jan 07:42 -0600, Christoph Berg wrote:
> Re: Nate Bargmann
> > ../../tlf/src/cqww_simulator.c:155:15: warning: adding 'int' to a string 
> > does not append to the string [-Wstring-plus-int]
> >                                     "+++" + 3 - slow);
> >                                     ~~~~~~^~~
> > ../../tlf/src/cqww_simulator.c:155:15: note: use array indexing to silence 
> > this warning
> > 
> > I'm going to be puzzling that one out for a bit.
> 
> As it says, use array indexing: "+++"[3 - slow]

No, the intention is string truncation of 0 to 3 - and + characters
prepending and appending the callsign.

I've attached a short C program that now compiles clean with clang
and gcc with a modification to the format string and the arguments.

73, Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819

Attachment: trial.c
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]