This discussion is archived
1 Reply Latest reply: Jul 13, 2012 6:39 AM by rahulras RSS

PROC and single quote issue

925089 Newbie
Currently Being Moderated
hello,

I encounter a little issue in the precompilation process of our PRO*C code.

It was designed to be compiled on Solaris with PRO*C and CC.

Now that we are changing to AIX, we have many simple modifications to make.

Our actual configuration is:
PRO*C/C++ Release 11.2.0.2.0
AIX 6.1.6.0

the PRO*C compilation options are sqlcheck=full , lines = yes , code =ansi_c parse=partial

Now we are puzzled by a specific issue.

The error code is common:
PCC-S-02021, Nouvelle ligne détectée au cours du balayage d'un littéral chaîne
Found newline while scanning string literal
or
PCC-S-02010 fin de fichier détecté au cours du balayage d'une constante chaine
found end-of-file while scanning string literal


the actual error comes from a simple quote in
sprintf(gtc_msg,"french sentence with a single quote ' and two constants '%s' '%s' ", Const1,Const2);

It was working with the old configuration, but now on AIX we have an error. It is "solved" by removing the simple quote ( the use of backslash \' does not work.)

Now that it's removed, it seems that the errors keep on rising from every single quote presented in strings and also in "//" comments line !

To resume, what kind of option is needed to make proc understand the simple quote as it was in our old server?
Or what could be the source of the problem.

Thanks a lot,


C.S.
  • 1. Re: PROC and single quote issue
    rahulras Explorer
    Currently Being Moderated
    sprintf is a standard C function. Pro*C is just a pre-compiler, which converts the .pc program into a C program.
    Have you tried writting a simple C program with sprintf having single quotes in format string?
    Compile it with your C compiler and run.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points