Re: [hackers] [dwm][PATCH RESEND 0/2] Const-correctness fixes

From: Chris Down <chris_AT_chrisdown.name>
Date: Mon, 22 Aug 2022 17:55:02 +0100

Quentin Rameau writes:
>> I beg to differ when the code declares something const but later then decides
>> >The constness is “maintained” here, the function gets a "const FcChar8 *"
>>
>> That's quite different: the code passes it a FcChar8* which it then treats as a
>> const FcChar8*. Case in point, GCC 12.1.1 and clang 14.0.6 both generate
>> different code.
>
>I don't see why it would, and I can't reproduce it with a simple test-case.
>Could you share a source/output somewhere of that?

Oh yes, it's for the execvp() changes, not this.

>> No, because FcChar8 is unsigned, but the default signedness of char may be
>> either way.
>
>And? FcNameParse will use whatever is passed
>as a pointer to an unsigned char.

With GCC 12.1.1 and our provided CFLAGS in config.mk:

     drw.c: In function ‘xfont_create’:
     drw.c:122:45: warning: pointer targets in passing argument 1 of ‘FcNameParse’ differ in signedness [-Wpointer-sign]
       122 | if (!(pattern = FcNameParse(fontname))) {
           | ^~~~~~~~
           | |
           | const char *
Received on Mon Aug 22 2022 - 18:55:02 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 22 2022 - 19:00:36 CEST