[cable] Problem running Cable compiled with GCC 3.2 on HP-UX 11

Steven Levitt slevitt at siac.com
Mon Dec 23 18:41:29 EST 2002


Thanks for your prompt reply. Fortunately, I've discovered the problem on
my own. There is nothing wrong with how I was building Cable, or with how I
was defining the gccxml-config file.

The problem is a defect in the Cable source code, specifically how it uses
the standard library function sscanf().

At line 538 in cableXMLSourceParser.cxx, you have the following code:

if(sscanf(lineStr.c_str(), "%ul", &line) == 1) { /*...*/ }

The problem is that "%ul" is not a valid conversion specifier for sscanf(),
at least not on my platform. I suspect that it isn't standard. The sscanf()
call always fails.

If I change the line to the following, it works:

if(sscanf(lineStr.c_str(), "%lu", &line) == 1) { /*...*/ }

According to the sscanf() man page, the "l" modifier is supossed to preceed
the "u".

I'm surprised that the compilers with which you develop Cable don't catch
this problem. Perhaps there is a more strictly conforming mode you can try?

There's a similar error on line 1006.

Again, thanks.




More information about the cable mailing list