How to add a bug report (and test program) and/or a wish-list item?

Anonymous
2013-12-12
2013-12-17
  • Anonymous - 2013-12-12

    Hi,
    Compiling with cobc, I'm ran into a minor bug. Assuming someone else might get to fix this before I do, how do I submit a problem report to the community? And if it isn't a bug, how about a "bells and whistles" request?

    Thanks,
    Jonathan

    The following little program demonstrates my find:

           IDENTIFICATION DIVISION.
           PROGRAM-ID. YBTEST.
           DATA DIVISION.
           WORKING-STORAGE SECTION.
           01 OUR-REC-ORD.
              03 FILLER PIC X(10) VALUE '0123456789'.
           PROCEDURE DIVISION.
           MAIN SECTION.
               MOVE 'ABCDEFGHIJ' TO OUR-REC-ORD
               DISPLAY "Starting with OUR-REC-ORD=" OUR-REC-ORD
               INITIALIZE OUR-REC-ORD(4:4)
               DISPLAY "& ending with OUR-REC-ORD=" OUR-REC-ORD
               STOP RUN.
    

    Compiling the program on the Mainframe, execution gives:

    STARTING WITH OUR-REC-ORD=ABCDEFGHIJ
    & ENDING WITH OUR-REC-ORD=ABC    HIJ
    

    Compiling it with cobc gives

    STARTING WITH OUR-REC-ORD=ABCDEFGHIJ
    & ENDING WITH OUR-REC-ORD=ABCDEFGHIJ
    
     
    Last edit: Simon Sobisch 2013-12-12
    • Brian Tiffin

      Brian Tiffin - 2013-12-12

      Hello Jonathan,

      We've been splintering the source tree a little bit, and that will be merged into a more focused release shortly.

      Here (in Discussion) isn't a bad place to place notes, but the plan is to move to the official ticket system for the project here on the forge. It's not monitored closely enough yet, but that will change for the better soon as well.

      Across the top menu, Tickets; split into Wishlist, Bug, Patch or Support.

      Cheers,
      Brian

       
    • Vincent (Bryan) Coen

      Interesting but it does work if you change the data div to:

             01 OUR-REC-ORD  PIC X(10) VALUE '0123456789'.
      

      Which when doing gives::

      [vince@study cobolsrc]$ cobc -x test1.cbl
      [vince@study cobolsrc]$ ./test1
      Starting with OUR-REC-ORD=ABCDEFGHIJ
      & ending with OUR-REC-ORD=ABC    HIJ
      

      So it indicates that filler areas are not being accessed correctly by initialize.
      E.g., it is totally ignoring file subordinates.

       
      Last edit: Simon Sobisch 2013-12-17
  • Simon Sobisch

    Simon Sobisch - 2013-12-12

    Hi Jonathan,

    this is surely a bug. For bug reports (and patches) the tickers are the best place to post them. For both bug reports and patches please always add the output from

    cobc --info
    

    or for older versions not supporting this command the output from

    cobc --version
    

    Simon

     
    Last edit: Simon Sobisch 2013-12-12
    • Simon Sobisch

      Simon Sobisch - 2013-12-14

      Ah, you got me...

      this is surely NO bug but a coding/design issue.
      INITIALIZE should not change any FILLER parts.
      INITIALIZE WITH FILLER should and does.

      In this case (INITIALIZE on a FILLER only part) we should output a warning.

      Does anybody know when INITIALIZE WITH FILLER became standard? We may should come up with a conf flag that decides if FILLER should be INITIALIZEd, too.

      Simon

       
      • Simon Sobisch

        Simon Sobisch - 2013-12-17

        Answer to my own question:
        standard INITIALIZE never changes filler items

        Quoted from ANSI INCITS 23-1985:

        Index data items and elementary FILLER data items are not affected by
        the execution of an INITIALIZE statement
        .

        Where 2002 adds the [WITH] FILLER phrase

        the following data items are excluded as receiving-operands [and are therefore unchanged]:
        [...] If the FILLER phrase is not specified, elementary data items with an explicit or implicit FILLER clause

        Therefore GNU Cobol is standard-conforming (and seem to work as MicroFocus and ACU-COBOL ever did, current ILE COBOL and Enterprise COBOL for z/OS docs state the same).

        If there are other vendors initializing all fillers by default we may should come up with a conf entry.

        Simon

         
        Last edit: Simon Sobisch 2013-12-17
  • Anonymous - 2013-12-14

    This bug appears in GNU-COBOL 2.0 from svn co svn://svn.code.sf.net/p/open-cobol/code/branches/gnu-cobol-2.0.

    When the system function 'C$PARAMSIZE' is called from a program with the clause IINITIAL,
    it returns the true length only on the first iteration, and returns zero on the others..

    Mod Edit: moved to [9629a677] as it is a complete new topic (and a real bug btw).

     

    Related

    Discussion: 9629a677


    Last edit: Simon Sobisch 2013-12-17
  • Simon Sobisch

    Simon Sobisch - 2013-12-17

    I've opened a wish-list [feature-requests:#25] and a bug item [bugs:#52].
    You can do this too (please register before).

    Simon

     

    Related

    Bugs: #287


Anonymous

Cancel  Add attachments