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

Re: cups-filters 1.16.2 released!

On 08/21/2017 03:50 PM, Adrian Bunk wrote:
On Mon, Aug 21, 2017 at 08:59:37AM -0300, Till Kamppeter wrote:

It happened during my warning clean-up. I wanted to get rid of all the
warning and one warning complained about an unnamed union in the
libfontembed, I did not succeed to solve this without naming the union,

First, I did not choose the flags which are used. Early in the history of cups-filters a contributor switched it over from the CUPS build system (cups-filters was started by splitting CUPS into CUPS and cups-filters, in the development cycle of CUPS 1.6.x) to an autotools build system.

Anonymous unions are part of C11.

gcc >= 5 defaults to C11, but your -std=gnu99 forces it to C99.

What is overall "better"? Or what is the newer, more modern standard? C11 or C99?

And cups-filters contains a weird combination of compiler flags:

         # Be tough with warnings and produce less careless code
         CFLAGS="$CFLAGS -Wall -pedantic -std=gnu99"

The things -pedantic warns about are not indications of bad code,
just of less portable code.

There are users of non-Linux systems, like *BSD, does this mean to better leave -pedantic in place?

-std=gnu99 means "C99 with all GNU extensions"
-D_GNU_SOURCE means "enable all extensions in the GNU C library"
-pedantic means "pedantic warnings for everything that is not in C99"

Do you want to enforce strict standards complicance for maximum
portability, or do you want to use everything available?

Based on how cups-filters is enabling extensions,
I'd suggest to solve this by removing the -pedantic.

Thanks. I will try changes of these flags. Probably I will first try to switch to C11 if it is an upgrade/modernization and not a downgrade. If so, I will return to the anonymous union, as having an extra, unnecessary name here is more confusing than helpful.


Reply to: