0

I've inherited about 1000 files that were written in C++ which I had to grudgingly convert to C. In one of the header files, a function is declared as

errnum DSPAPI aaCxSVD(complexnum *input_matrix,[...],intnum jobz=0);

which yields the following compilation error in XCode:

error: expected ';', ',' or ')' before '=' token

if I simply do intnum 0, I get:

error: expected ';', ',' or ')' before numeric constant

if I remove intnum, I get:

error: expected declaration specifiers or '...' before numeric constant

In the C file itself, different results get returned if jobz = 0 or not. Currently, it's the only header that ever mentions that function.

My question is thus: is there any legal way of doing this? is it even necessary?

Rasman
  • 5,349
  • 1
  • 25
  • 38

1 Answers1

3

jobz has been given a default value. This is a C++-only feature.

I would say that the easiest way to convert this is simply to remove the =0. Then, find all locations where aaCxSVD() is being called without providing an explicit final parameter, and tack on 0.

Oliver Charlesworth
  • 267,707
  • 33
  • 569
  • 680