Skip to content

Compiling with clang gives errors #245

@steve-chavez

Description

@steve-chavez

Problem

On the Makefile add:

 include $(PGXS)
 
+CC=clang
+

Then compiling fails:

$ xpg build

clang  -DEXTVERSION=\"0.20.1\" -I. -I./ -I/nix/store/0w1fdnxbhd0hnjvbwcl8py6hgzzk506l-postgresql-17.0/include/server -I/nix/store/0w1fdnxbhd0hnjvbwcl8py6hgzzk506l-postgresql-17.0/include/inter
nal -I/nix/store/zfi1y943q15js1ysgl4vk6lp2bzrngn2-icu4c-73.2-dev/include -D_GNU_SOURCE -I/nix/store/37979sqc7yw9ps0c4xl9jjkhq0w1hw8b-libxml2-2.12.7-dev/include/libxml2 -I/nix/store/ks2x6si7bkx
b6ay1s80ld1s5997qllpa-lz4-1.9.4-dev/include -I/nix/store/9ynakmwsf7nqhlv3phl05yybc5ad754l-zstd-1.5.6-dev/include  -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werr
or=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=stand
ard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -std=c11 -Wextra -Wall -Werror -Wno-declaration-after-statement -Wno-vla -Wno-long-long -fPIC -fvisibility=hidden -c src/core.c -o bu
ild-17/core.o

error: unknown warning option '-Wimplicit-fallthrough=3'; did you mean '-Wimplicit-fallthrough'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wshadow=compatible-local'; did you mean '-Wshadow-uncaptured-local'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wno-stringop-truncation'; did you mean '-Wno-format-truncation'? [-Werror,-Wunknown-warning-option]
make: *** [Makefile:65: build-17/core.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions