[DTrace-devel] [PATCH 1/3] Fix "missing braces" message with older compilers

Kris Van Hees kris.van.hees at oracle.com
Fri Dec 1 15:10:47 UTC 2023


I believe this fixes a problem that is reported by the GCC 4.8.5 compiler (default on OL7 it seems).  So -*really* pretty old.  I wouldn't worry about these compiler warnings, personally.  I'd rather not overly avoid them at the cost of code that could possibly be too implementation-dependent.
________________________________
From: Nick Alcock via DTrace-devel <dtrace-devel at oss.oracle.com>
Sent: Friday, December 1, 2023 10:06 AM
To: eugene.loh--- via DTrace-devel <dtrace-devel at oss.oracle.com>
Subject: Re: [DTrace-devel] [PATCH 1/3] Fix "missing braces" message with older compilers

On 30 Nov 2023, eugene loh uttered the following:

> From: Eugene Loh <eugene.loh at oracle.com>
>
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
> ---
>  dtprobed/dtprobed.c   | 2 +-
>  libdtrace/dt_proc.c   | 8 ++++----
>  libdtrace/dt_symtab.c | 2 +-
>  libport/daemonize.c   | 2 +-
>  4 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/dtprobed/dtprobed.c b/dtprobed/dtprobed.c
> index 507a412a..c2e93d48 100644
> --- a/dtprobed/dtprobed.c
> +++ b/dtprobed/dtprobed.c
> @@ -848,7 +848,7 @@ main(int argc, char *argv[])
>        char *devname = "dtrace/helper";
>        int sync_fd = -1;
>        int ret;
> -     struct sigaction sa = {0};
> +     struct sigaction sa = {{0}};

This depends on an implementation detail of glibc (that struct sigaction
happens to have a union in it as the first member) just to get rid of a
pedantic warning. This feels... excessive to me?

How old are 'older compilers' anyway?

--
NULL && (void)

_______________________________________________
DTrace-devel mailing list
DTrace-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/dtrace-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://oss.oracle.com/pipermail/dtrace-devel/attachments/20231201/576075f9/attachment.html>


More information about the DTrace-devel mailing list