Opened 3 years ago

Closed 3 years ago

#5002 closed defect (fixed)

liblwgeom builds with no warning flags by default

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.2.0
Component: build Version: master
Keywords: Cc: Algunenano

Description

I've spent a lot of time to find out I was passing the wrong format to lwdebug(), and I've realized the default build of liblwgeom happens with no -Wall (or any other -W flag). I think we want all warnings enabled by default, as it happens under postgis/

Change History (6)

comment:1 by strk, 3 years ago

The warning that would have saved me a lot of time should be -Wformat

comment:2 by strk, 3 years ago

It looks like the default -Wall flag (and others) were intentionally removed with [cdd520d378efb2d6b0b3ced7de566107a2a5b4a2/git] by Raúl mentioning issue #4630

comment:3 by strk, 3 years ago

Cc: Algunenano added

Algunenano do you agree to re-add -Wall to CFLAGS ? I guess we used a DIFFERENT variable to avoid having duplicated flags when building the PostgreSQL-dependent code which already uses flags from PostgreSQL build

comment:4 by Algunenano, 3 years ago

I think we want all warnings enabled by default, as it happens under postgis/

That's not correct. As you mentioned later, postgis/ gets any extra flags declared by postgresql, so your '-Wall' likely comes from Postgresql compilation.

Algunenano do you agree to re-add -Wall to CFLAGS ?

I'm not against it as long as it's added everywhere, that is, to all build files and not only to certain folders.

Have you considered setting up your environment variables to match your development requirements? For example, my CFLAGS look something like this:

-march=native -mtune=native -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wall -Wextra -Wno-unused-parameter -g3 -gdwarf -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer

And whenever I build a project (Postgis or any other) I use those flags. I don't have to depend on whether autotools, cmake or whatever is used by the project, sets warnings or not, only how to pass my flags.

comment:6 by strk, 3 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.