(XS) RFR: 8077674: BSD build failures due to undefined macros
Dmitry Samersoff
dmitry.samersoff at oracle.com
Thu Apr 16 06:49:36 UTC 2015
David,
There are two different CPP styles
One is
#ifdef VAR
Other one is
#if defined(VAR)
They are equivalent and either of them looks good for me, so I don't see
a reason to change all defines across entire hotspot code but
I would prefer to don't mix two styles within the single #if block.
-Dmitry
On 2015-04-14 23:25, David Holmes wrote:
> Hi Dmitry,
>
> On 14/04/2015 9:25 PM, Dmitry Samersoff wrote:
>> David,
>>
>> It's better to change
>>
>> #ifdef __APPLE__
>>
>> to
>>
>> #if defined(__APPLE__)
>
> Why? They seem 100% equivalent. Plus that would mean a lot of changes.
> Plus we use that pattern in many, many, many places.
>
> Thanks,
> David
>
>> -Dmitry
>>
>>
>> On 2015-04-14 13:20, David Holmes wrote:
>>> webrev:
>>>
>>> http://cr.openjdk.java.net/~dholmes/8077674/webrev/
>>>
>>> From the original error report:
>>>> "-Wundef option causes GCC to warn whenever it encounters an identifier
>>>> which is not a macro in an ‘#if’. "
>>>>
>>>> Hence we should be using
>>>>
>>>> #elif defined(__FreeBSD__)
>>>>
>>>> etc in this context.
>>>
>>> I also founds similar suspect usages in os_linux.cpp and os_windows.cpp.
>>>
>>> Thanks,
>>> David
>>
>>
--
Dmitry Samersoff
Oracle Java development team, Saint Petersburg, Russia
* I would love to change the world, but they won't give me the sources.
More information about the hotspot-runtime-dev
mailing list