Menu

#248 >>DEFINE evaluated inside false >>ELSE

GC 2.2
closed
CDF (5)
5 - default
2017-04-10
2016-06-17
No

https://sourceforge.net/p/open-cobol/discussion/cobol/thread/c7fda487/#d6ab

For better understanding I'll copy/paste the "source" and then I'll send it full as attachement.

Here it is:

:::cobolfree
   >>SOURCE FORMAT FIXED

       COPY "SDKDDKVer.cpy".

   IDENTIFICATION DIVISION.
   PROGRAM-ID. TESTING.

   ENVIRONMENT DIVISION.
   CONFIGURATION SECTION.

   DATA DIVISION.
   WORKING-STORAGE SECTION.

   PROCEDURE DIVISION.
   Begin-Program.

   *> NB: _WIN32_WINNT is defined.
   >>IF _WIN32_WINNT DEFINED
       >>DISPLAY _WIN32_WINNT DEFINED
       DISPLAY
          "_WIN32_WINNT DEFINED"
       END-DISPLAY.
   >>ELSE
       *> This should not be evaluated.
       >>DISPLAY _WIN32_WINNT NOT DEFINED
       >>DEFINE _WIN32_WINNT 1
       DISPLAY
          "_WIN32_WINNT NOT DEFINED"
       END-DISPLAY.
   >>END-IF

   End-Program.
       GOBACK.

   END PROGRAM TESTING.

which produces the following output:

MM@CROSSHAIR2 [D:\DEV\MM\test\CDF]
$ cobc -x -v -D_WIN32_WINNT=1 test.cbl
Loading standard configuration file 'default.conf'
Command line: cobc -x -v -D_WIN32_WINNT=1 test.cbl
Preprocessing: test.cbl -> D:\DEV\GnuCOBOL\2.0\temp\cob2936_0.cob
_WIN32_WINNT DEFINED
test.cbl (24): Error: Duplicate define
Return status: 1

Cheers,

MM

1 Attachments

Related

Bugs: #99

Discussion

  • Edward Hart

    Edward Hart - 2016-06-23
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -4,6 +4,8 @@
    
     Here it is:
    
    +~~~~
    +:::cobolfree
        >>SOURCE FORMAT FIXED
    
            COPY "SDKDDKVer.cpy".
    @@ -37,9 +39,11 @@
            GOBACK.
    
        END PROGRAM TESTING.
    +~~~~
    
     which produces the following output:
    
    +~~~~
     MM@CROSSHAIR2 [D:\DEV\MM\test\CDF]
     $ cobc -x -v -D_WIN32_WINNT=1 test.cbl
     Loading standard configuration file 'default.conf'
    @@ -48,6 +52,7 @@
     _WIN32_WINNT DEFINED
     test.cbl (24): Error: Duplicate define
     Return status: 1
    +~~~~
    
     Cheers,
    
     
  • Edward Hart

    Edward Hart - 2016-06-23
    • summary: An "old" CDF constant problem that was never resolved... --> >>DEFINE evaluated inside false >>ELSE
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -22,12 +22,14 @@
        PROCEDURE DIVISION.
        Begin-Program.
    
    
    +   *> NB: _WIN32_WINNT is defined.
        >>IF _WIN32_WINNT DEFINED
            >>DISPLAY _WIN32_WINNT DEFINED
            DISPLAY
               "_WIN32_WINNT DEFINED"
            END-DISPLAY.
        >>ELSE
    +       *> This should not be evaluated.
            >>DISPLAY _WIN32_WINNT NOT DEFINED
            >>DEFINE _WIN32_WINNT 1
            DISPLAY
    
     
  • Edward Hart

    Edward Hart - 2016-06-23
    • labels: --> CDF
    • status: open --> accepted
    • assigned_to: Edward Hart
     
  • Edward Hart

    Edward Hart - 2016-06-25
    • status: accepted --> closed
     
  • Edward Hart

    Edward Hart - 2016-06-25

    Fixed in [r955]. Thanks for reporting it, Mario.

     

    Last edit: Edward Hart 2016-06-25

Log in to post a comment.

MongoDB Logo MongoDB