configure: Build with -Wwrite-strings.

libs/vkd3d-shader/hlsl.c: In function ‘declare_predefined_types’:
libs/vkd3d-shader/hlsl.c:3408:10: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
         {"technique",    9},
          ^~~~~~~~~~~
...
programs/vkd3d-compiler/main.c: In function ‘parse_formatting’:
programs/vkd3d-compiler/main.c:303:10: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
         {"colour",  VKD3D_SHADER_COMPILE_OPTION_FORMATTING_COLOUR},
          ^~~~~~~~
...

macOS tigetstr() takes a non-const char *, so account for that as well.
This commit is contained in:
Henri Verbeet 2024-02-22 13:08:36 +01:00 committed by Alexandre Julliard
parent 7029d821be
commit d65f331efc
Notes: Alexandre Julliard 2024-02-22 23:05:00 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/668
4 changed files with 5 additions and 4 deletions

View File

@ -70,6 +70,7 @@ AS_IF([test "x${GCC}" = "xyes"],
VKD3D_CHECK_CFLAGS([-Wtype-limits])
VKD3D_CHECK_CFLAGS([-Wunused-but-set-parameter])
VKD3D_CHECK_CFLAGS([-Wvla])
VKD3D_CHECK_CFLAGS([-Wwrite-strings])
VKD3D_CHECK_CFLAGS([-Wl,--no-undefined])])
dnl Check for cross compilers

View File

@ -3403,7 +3403,7 @@ static void declare_predefined_types(struct hlsl_ctx *ctx)
static const struct
{
char *name;
const char *name;
unsigned int version;
}
technique_types[] =

View File

@ -295,7 +295,7 @@ static bool parse_formatting(uint32_t *formatting, bool *colour, char *arg)
{
static const struct formatting_option
{
char *name;
const char *name;
enum vkd3d_shader_compile_option_formatting_flags value;
}
opts[] =
@ -694,7 +694,7 @@ static bool has_colour(FILE *f)
setupterm(NULL, fileno(f), &ret);
if (ret != 1)
return false;
supported = !!tigetstr("setaf");
supported = !!tigetstr((char *)"setaf");
del_curterm(cur_term);
return supported;

View File

@ -71,7 +71,7 @@ static bool has_colour(void)
setupterm(NULL, fileno(stdout), &ret);
if (ret != 1)
return false;
supported = !!tigetstr("setaf");
supported = !!tigetstr((char *)"setaf");
del_curterm(cur_term);
return supported;