ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

The character } is not a valid C source character.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • The character } is not a valid C source character.

    Hi

    I have simple c programm:
    int main(void)
    {
    return 0;
    }

    14 - for compilation and error
    The character } is not a valid C source character.

    What I make wrong?

    Regards

  • #2
    Re: The character } is not a valid C source character.

    Not sure. That should work.

    What is your source type and / or what command are you using to compile?
    Michael Catalani
    IS Director, eCommerce & Web Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

    Comment


    • #3
      Re: The character } is not a valid C source character.

      type: C
      Compilation-14, Enter

      Comment


      • #4
        Re: The character } is not a valid C source character.

        It is a CCSID issue. Make sure the CCSID of your source file matches the CCSID of your emulator and your job. The } character will probably look different. If you retype it as }, your compile should work ok.

        If it's impossible to deal with the CCSID issue, C has an alternate syntax called "trigraphs". ??< and ??> are the trigraphs for the curly braces. But that's very nasty if you have a lot of code.

        Code:
        int main(void)
        ??<
           return 0;
        ??>

        Comment


        • #5
          Re: The character } is not a valid C source character.

          Thank you Barbara.
          ??< works ok, but I have a lot of code to change it.
          I have on my profile and source file CCSID=273.
          I tried #pragma convert(273) and also compilation parameter CRTBNDC TGTCCSID(37), but it still doesn't work.
          Any Idea?

          Comment


          • #6
            Re: The character } is not a valid C source character.

            Originally posted by GregDrazek View Post
            Thank you Barbara.
            ??< works ok, but I have a lot of code to change it.
            I have on my profile and source file CCSID=273.
            I tried #pragma convert(273) and also compilation parameter CRTBNDC TGTCCSID(37), but it still doesn't work.
            Any Idea?
            I don't recommend using the trigraphs except for an emergency.

            What is the hex value of the } character in the source file? (DSPPFM, F10)

            You could try posting your question to the C400-L mailing list at midrange.com. I think one of the C compiler developers from IBM watches that forum.

            Comment


            • #7
              Re: The character } is not a valid C source character.

              I would suggest making sure your job CCSID is set to the proper value.

              I normally see problems like this with CCSID=65535. If you have that, you'll almost certainly have problems all over the place (unless you avoid variant characters completely -- such as using trigraphs.. but trigraphs make the code hard to read, IMHO)

              Comment


              • #8
                Re: The character } is not a valid C source character.

                Hex value of the } is D0 (DSPPFM, F10)

                Comment


                • #9
                  Re: The character } is not a valid C source character.

                  Thank you all for answers.
                  I have solution: It was connection parameter in Symtrax Telnet (Language=37), should be 273.
                  Help come from: midrange.com

                  Comment

                  Working...
                  X