Re: Compiler warnings with --enable-dtrace

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Compiler warnings with --enable-dtrace
Date: 2018-05-07 16:42:58
Message-ID: 23524.1525711378@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Юрий Соколов 2018-05-07 16:54:27 Re: [HACKERS] Clock with Adaptive Replacement
Previous Message Alexander Korotkov 2018-05-07 16:26:25 Re: doc fixes: vacuum_cleanup_index_scale_factor