cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: VMS fixes needed to allow building

From: Tom Grace <Thomas.Grace_at_amdocs.com>
Date: Wed, 13 Mar 2013 00:17:59 +0000

>From: Yang Tse <yangsita_at_gmail.com<mailto:yangsita_at_gmail.com?Subject=Re:%20VMS%20fixes%20needed%20to%20allow%20building>>
>Date: Wed, 13 Mar 2013 00:30:11 +0100

>On Wed, Mar 13, 2013, Tom Grace <Thomas.Grace_at_amdocs.com> wrote:

>>>Ok, I understand that declaring it with 'globaldef' instead of
>>>'static' in tool_main.c makes it a single instance variabe that is
>>>'visible' and can be modified from any other source file which happens
>>>to include tool_vms.h with its forward-declaration. Is this correct?
>> Oh yea,, a more portable version of globaldef is to just say
>> the following placed Outside the function, But the globaldef
>> could be placed anywhere.
>>
>> int vms_show; /* placed outside the function */
>>
>> The above will also work as the edit for tool_main.c

>Ideally we would want that definition to be auto-initialized by the
>compiler to 0. That was the reason for declaring it static. Would it
>be possible to achieve this somehow without having to initialize it to
>0 at the beginning of function main() ?

DECC implementation of extern has always jittery to me,

But at least its compliant now. Plus there are compile

time switches eehh.

An extern submits a psect and a global reference to

the linker to point to it.

Using "extern int vms_show = 0" also creates

a globaldef.

The use of the extern by itself does declare a psect but

does not declare a globalsymbol.

It does declare a globalref. But the linker needs

one and only one globaldef or there is an error.

Thus two modules

Extern int vms_show;

Extern int vms_show;

Does not work for the linker as these are two refs without a def.

But change one of em with one of the following

Extern int vms_show=0;

Or

Globaldef int vms_show;

And your good.

This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-13