Re: Compiler warnings with --enable-dtrace - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Compiler warnings with --enable-dtrace
Date
Msg-id 23524.1525711378@sss.pgh.pa.us
Whole thread Raw
In response to Compiler warnings with --enable-dtrace  (Thomas Munro <thomas.munro@enterprisedb.com>)
Responses Re: Compiler warnings with --enable-dtrace  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Compiler warnings with --enable-dtrace  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
Thomas Munro <thomas.munro@enterprisedb.com> writes:
> --enable-dtrace produces compiler warnings about const correctness,
> except on macOS.  That's because Apple's dtrace produces function
> declarations in probes.h that take strings as const char * whereas
> AFAIK on all other operating systems they take char * (you can see
> that possibly recent difference in Apple's version of dt_header_decl()
> in dt_program.c).  People have complained before[1].

Yeah, it's a bit annoying, although AFAICT hardly anyone uses dtrace.

> Maybe we should do what the Perl people do[2] and post-process the
> generated header file to add const qualifiers?  Please see attached.

+1 for the idea.  I notice that Perl's version of this is careful
not to munge lines that already contain "const" ... do we need to
worry about that?

            regards, tom lane


pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: doc fixes: vacuum_cleanup_index_scale_factor
Next
From: Юрий Соколов
Date:
Subject: Re: [HACKERS] Clock with Adaptive Replacement