Pre-ANSI C functions and .NET browse information symbols

R

RK

I need to compile a library of C code with pre-ANSI C functions using MS
..NET 2003. The functions are declared something like this:

int myFunction(p)
double p;
{
int x;
code here...
return x;
}

The compilation proceeds without a glitch but when I tell .NET to build
browse information for the functions, it seems not to include the pre-ANSI
functions in browse information.

I could manually make the functions ANSI compliant by changing the code but
there are 75+ functions. This seems to work for a few functions that I have
altered. Is there a switch that tells .NET that the functions are pre-ANSI
style so that it can build the browse information correctly or some other
way to get the functions into the browse information?

Thanks,
RK
 
R

Randy Howard

I need to compile a library of C code with pre-ANSI C functions using MS
.NET 2003. The functions are declared something like this:

int myFunction(p)
double p;
{
int x;
code here...
return x;
}

The compilation proceeds without a glitch but when I tell .NET to build
browse information for the functions, it seems not to include the pre-ANSI
functions in browse information.

I could manually make the functions ANSI compliant by changing the code but
there are 75+ functions. This seems to work for a few functions that I have
altered.

There are a lot of benefits to moving them forward in time to the 1980s. Just
do it and be done with it. You might also find that some subtle problems get
uncovered (and fixed) in this process.
 
J

Jonathan Burd

RK said:
I need to compile a library of C code with pre-ANSI C functions using MS
.NET 2003. The functions are declared something like this:

int myFunction(p)
double p;
{
int x;
code here...
return x;
}

The compilation proceeds without a glitch but when I tell .NET to build
browse information for the functions, it seems not to include the pre-ANSI
functions in browse information.

I could manually make the functions ANSI compliant by changing the code but
there are 75+ functions. This seems to work for a few functions that I have
altered. Is there a switch that tells .NET that the functions are pre-ANSI
style so that it can build the browse information correctly or some other
way to get the functions into the browse information?

Thanks,
RK

You can use this feature of GCC to generate the ANSI prototypes
for your functions and then simply copy-n-paste them replacing stuff.

gcc -c *.c -aux-info prog.h

Or, better:

http://sourceforge.net/projects/cproto/

Regards,
Jonathan.
 
S

Servé La

RK said:
I could manually make the functions ANSI compliant by changing the code but
there are 75+ functions. This seems to work for a few functions that I have
altered. Is there a switch that tells .NET that the functions are pre-ANSI
style so that it can build the browse information correctly or some other
way to get the functions into the browse information?

75 is not a lot. Pay me for half a day and I'll do it :)
 
J

Jonathan Burd

Jonathan said:
You can use this feature of GCC to generate the ANSI prototypes
for your functions and then simply copy-n-paste them replacing stuff.

gcc -c *.c -aux-info prog.h

Or, better:

http://sourceforge.net/projects/cproto/

Regards,
Jonathan.

<ot>
[Your email address isn't available, so:]
Supplementary information:
To build cproto using OpenWatcom and UnxUtils:
1. Edit the watcom.mak makefile.
2. Replace "lex" with "flex" and "yacc" with "bison".
3. At the command prompt:
wmake /u /f watcom.mak
4. cproto --help

UnxUtils: unxutils.sourceforge.net
OpenWatcom: www.openwatcom.org
</ot>

Regards,
Jonathan.
 
R

RK

Thanks to those who replied. I will change the functions to make them ANSI
compliant. One more thing that I forgot to mention in my original post -
Visual Studio 6.0 does recognize pre-ANSI functions and correctly builds
browse information for them...

Regards,
RK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top