Pre-ANSI C functions and .NET browse information symbols

Discussion in 'C Programming' started by RK, Jan 31, 2005.

  1. RK

    RK Guest

    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
     
    RK, Jan 31, 2005
    #1
    1. Advertising

  2. RK

    Randy Howard Guest

    In article <>, says...
    > 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.

    --
    Randy Howard (2reply remove FOOBAR)
     
    Randy Howard, Jan 31, 2005
    #2
    1. Advertising

  3. RK wrote:
    > 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.

    --
    "We must do something. This is something. Therefore, we must do this."
    - Keith Thompson
     
    Jonathan Burd, Jan 31, 2005
    #3
  4. RK

    Servé La Guest

    "RK" <> schreef in bericht
    news:p...
    > 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 :)
     
    Servé La, Jan 31, 2005
    #4
  5. Jonathan Burd wrote:
    > RK wrote:
    >
    >> 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.
    >


    <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.

    --
    "We must do something. This is something. Therefore, we must do this."
    - Keith Thompson
     
    Jonathan Burd, Jan 31, 2005
    #5
  6. RK

    RK Guest

    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


    "RK" <> wrote in message
    news:p...
    >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
    >
    >
     
    RK, Feb 1, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Connolly

    pre ANSI code and writable-strings?

    Paul Connolly, Oct 12, 2006, in forum: C Programming
    Replies:
    7
    Views:
    383
    Gordon Burditt
    Oct 17, 2006
  2. Replies:
    1
    Views:
    518
  3. Replies:
    11
    Views:
    1,117
    Keith Thompson
    Apr 28, 2008
  4. Frank Iannarilli

    pre-ansi to ansi c++ conversion?

    Frank Iannarilli, Jul 21, 2009, in forum: C++
    Replies:
    2
    Views:
    440
  5. Replies:
    0
    Views:
    242
Loading...

Share This Page