[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] Bug List comments
From: |
Bernard Giroud |
Subject: |
Re: [open-cobol-list] Bug List comments |
Date: |
Mon Nov 1 08:48:20 2004 |
----- Original Message -----
From: "Roger While" <address@hidden>
To: <address@hidden>
Cc: <address@hidden>; <address@hidden>
Sent: Sunday, October 31, 2004 6:58 PM
Subject: [open-cobol-list] Bug List comments
>
> The compiler abort problem (sy012.cob) is caused
> by a negated test on an 88 level for a pointer item.
> Like this :
> 01 XXX.
> 03 MYPTR POINTER VALUE NULL.
> 88 MYPTR-NULL VALUE NULL.
>
> IF NOT MYPTR-NULL
> ....
>
> Question here is if it is valid to have an 88 on a
> POINTER item ? The only use I can see is exactly as
> above (and in sy012.cob) to test for NULL.
> ACU rejects the 88, MF accepts it but according to MF doc
> it shouldn't - Hmm.
>
> Keisuke ? Bernard ? Thoughts ? Reject the 88 or not ?
IMHO, 88 on a pointer is legal. Moreover, my compiler
Compaq (HP) COBOL V2.7 handles happily something
like:
WORKING-STORAGE SECTION.
01 XXX.
03 MYPTR POINTER VALUE 0.
88 MYPTR-NULL VALUE 0.
88 MYPTR-STATIC VALUE 0 THRU 200000.
PROCEDURE DIVISION.
principal section.
MAIN-LINE-BEGIN.
set myptr to reference xxx.
IF NOT MYPTR-NULL
display "not null"
display myptr
else
display "null"
end-if
IF MYPTR-STATIC
display "STATIC"
else
display "DYN"
end-if
The only thing it doesn't accept is the NULL keyword :-((
>
> For info: the problem appears in typeck.c in
> function expr_reduce - case "!". TREE_CLASS is
> POINTER, therefore cb_build_binary_op gets called
> with parameter expr_op which is 0.
>
> Roger
Bernard Giroud
Credit Lyonnais (Suisse) SA
********************************************************************************
This e-mail contains confidential information or information belonging
to the Credit Lyonnais Group entity sending it and is intended solely
for the addressees. Any views expressed in this message are those of
the individual sender and its contents do not constitute a commitment
by Credit Lyonnais unless confirmed by letter or fax. The unauthorised
disclosure, use, dissemination or copying (either whole or partial) of
this e-mail, or any information it contains, is prohibited. E-mails are
susceptible to alteration and their integrity cannot be guaranteed.
Internet communications are not secured and therefore Credit Lyonnais
shall not be liable for this e-mail if modified or falsified. If you
are not the intended recipient of this e-mail, please delete it
immediately from your system and notify the sender of the wrong
delivery and the mail deletion.
********************************************************************************
- Re: [open-cobol-list] Bug List comments,
Bernard Giroud <=