Compiler warnings with --enable-dtrace

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: dap(at)joyent(dot)com, Dave Page <dpage(at)pgadmin(dot)org>
Subject: Compiler warnings with --enable-dtrace
Date: 2018-05-05 13:22:03
Message-ID: CAEepm=2j1pWSruQJqJ91ZDzD8w9ZZDsM4j2C6x75C-VryWg-_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

--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].

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

I have just added --enable-dtrace to my build farm animal elver so
these warnings should appear at the next build. I wonder if the
owners of damselfly, castoroides, protosciurus (CCed) would consider
adding it for them too so that we could get some coverage of this
build option on Illumos and Solaris.

[1] https://www.postgresql.org/message-id/flat/38D06FCCB225BA1C6699D4E7%40amenophis
[2] https://github.com/Perl/perl5/blob/a385812b685b3164e706880a72ee60c9cc9573e4/Makefile.SH#L870

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
0001-Fix-const-warnings-when-building-with-enable-dtrace.patch application/octet-stream 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-05-05 15:55:03 Re: Python 3.7 support
Previous Message Amit Kapila 2018-05-05 12:56:34 Re: Explain buffers wrong counter with parallel plans