Menu

Warning and errors compiling Jay Moseley's tape utilities.

2025-03-25
2025-03-25
  • Marco Antoniotti

    Hi

    I am trying to compile Jay Moseley's tape utilities on my Intel Mac
    https://www.jaymoseley.com/hercules/awstape_utilities/cobolawsutilities.htm
    Jay is in cc:, since I don't know if he is on this list.

    Here is the version of the compiler I use.

    bash-5.2$ cobc --version
    cobc (GnuCOBOL) 3.2.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <
    https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward
    Hart
    Built Jul 28 2023 18:42:18
    Packaged Jul 28 2023 17:02:56 UTC
    C version "Apple LLVM 15.0.0 (clang-1500.0.40.1)"

    I attach a file with all the warnings and errors I get. It looks like it
    is a semi-trivial encoding issue.

    Apart from that, I see a
    COPY 'screenio.cpy'.
    statement in the code, but there is no trace of screenio.cpy. Is it a
    standard GNUCobol file?

    I compile the utility with
    bash-5.2$ cobc -x maketape.cbl 2> maketape-warn.txt

    Any ideas?

    Thanks

    All the best

    Marco

    --
    Marco Antoniotti, Professor, Director tel. +39 - 02 64 48 79 01
    DISCo, University of Milan-Bicocca U14 2043 http://dcb.disco.unimib.it
    Viale Sarca 336
    I-20126 Milan (MI) ITALY

    CSCE 2025 - csce.lakecomoschool.org

     
    • Jay Moseley

      Jay Moseley - 2025-03-25

      On 3/25/25 15:05, Marco Antoniotti wrote:

      Hi

      I am trying to compile Jay Moseley's tape utilities on my Intel Mac
      https://www.jaymoseley.com/hercules/awstape_utilities/
      cobolawsutilities.htm https://www.jaymoseley.com/hercules/ awstape_utilities/cobolawsutilities.htm Jay is in cc:, since I don't
      know if he is on this list.

      Marco,

      Yes, I am on this list. In my Linux system, the GnuCOBOL copy files are
      located in: /usr/local/share/gnucobol/copy and the version of GnuCOBOL I
      am running here is identical to yours: 3.2.0.

      There may be a setting that is necessary to export the copy directory
      identity, but I do not know what that might be. I only know that it has
      been discussed before. I will see if I can research it, but perhaps
      someone who knows the answer without research will reply.

      Jay

       
  • Anonymous

    Anonymous - 2025-03-25

    The warnings are all from clang (in your setup the C compiler that is executed by cobc after it generates intermediate C):

    warning: illegal character encoding in string literal [-Winvalid-source-encoding]

    If I understood the information I've checked correctly, then the issue is that clang has the limitation that it expects all source files (the ones that cobc generates) to be in UTF8. And by default it warns if literals are not valid utf8.

    You can try two things:
    * tell cobc to encode all non-plain 7bit ascii characters:
    LC_CTYPE=C cobc -x maketape.cbl (we check for printable characters of the current ctype and encode the others - don't export LC_CTYPE in general...).
    * tell cobc to tell clang to shut up: cobc -x -A -Wno-invalid-source-encoding maketape.cbl (you could also do that "permanently" by exporting an environment variable)

     
    • Marco Antoniotti

      Thanks.

      Yep. Both tricks - the LC_TYPE and -Wno-invalid-source-encoding - work.

      Thank you.

      Jay, I found the copybooks. They are in the same directory on my Mac; I
      guess brew put them there.

      All the best

      Marco

      On Tue, Mar 25, 2025 at 9:33 PM noreply@sourceforge.net wrote:

      The warnings are all from clang (in your setup the C compiler that is
      executed by cobc after it generates intermediate C):

      warning: illegal character encoding in string literal
      [-Winvalid-source-encoding]

      If I understood the information I've checked correctly, then the issue is
      that clang has the limitation that it expects all source files (the ones
      that cobc generates) to be in UTF8. And by default it warns if literals are
      not valid utf8.

      You can try two things:
      * tell cobc to encode all non-plain 7bit ascii characters:
      LC_CTYPE=C cobc -x maketape.cbl (we check for printable characters of the
      current ctype and encode the others - don't export LC_CTYPE in general...).
      * tell cobc to tell clang to shut up: cobc -x -A
      -Wno-invalid-source-encoding maketape.cbl (you could also do that
      "permanently" by exporting an environment variable)


      Warning and errors compiling Jay Moseley's tape utilities.
      https://sourceforge.net/p/gnucobol/discussion/help/thread/00c48de3e7/?limit=50#f4f4


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/gnucobol/discussion/help/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      Marco Antoniotti, Professor, Director tel. +39 - 02 64 48 79 01
      DISCo, University of Milan-Bicocca U14 2043 http://dcb.disco.unimib.it
      Viale Sarca 336
      I-20126 Milan (MI) ITALY

      CSCE 2025 - csce.lakecomoschool.org

       

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.