Re: Dead code in ps_status.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Dead code in ps_status.c
Date: 2023-02-16 14:38:18
Message-ID: 2269202.1676558298@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Munro <thomas(dot)munro(at)gmail(dot)com> writes:
> On Thu, Feb 16, 2023 at 6:34 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Hm, is "defined(sun)" true on any live systems at all?

> My GCC compile farm account seems to have expired, or something, so I
> couldn't check on wrasse's host (though whether wrasse is "live" is
> debatable: Solaris 11.3 has reached EOL, it's just that the CPU is too
> old to be upgraded, so it's not testing a real OS that anyone would
> actually run PostgreSQL on). But from some googling[1], I think
> __sun, __sun__ and sun should all be defined.

My account still works, and what I see on wrasse's host is

tgl(at)gcc-solaris11:~$ gcc -x c /dev/null -dM -E | grep -i svr
#define __SVR4 1
#define __svr4__ 1
tgl(at)gcc-solaris11:~$ gcc -x c /dev/null -dM -E | grep -i sun
#define __sun 1
#define sun 1
#define __sun__ 1

I don't know a way to get the list of predefined macros out of the
compiler wrasse is actually using (/opt/developerstudio12.6/bin/cc),
but doing some experiments with #ifdef confirmed that it defines
__sun, __sun__, and __svr4__, but not __svr5__.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan S. Katz 2023-02-16 15:06:37 Re: Move defaults toward ICU in 16?
Previous Message Tomas Vondra 2023-02-16 14:07:59 Re: PATCH: Using BRIN indexes for sorted output