question about VC++ 6

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luca

    question about VC++ 6

    Hi everybody, I have a little problem with Visual C++ 6.0
    My project is a mixture of C and C++ code
    I have many C functions whose definition follows the old-style, like
    the following:

    *************** *************** *************** *************** *************** ***
    bool_t *
    datiambientalia uto_ntfy_1(argp , clnt)
    RPCST_DATI_AMB_ AUTO_NTFY *argp;
    CLIENT *clnt;
    {
    static bool_t res;

    bzero(&res, sizeof(res));
    if (clnt_call(clnt , datiAmbientaliA uto_ntfy,
    xdr_RPCST_DATI_ AMB_AUTO_NTFY, argp, xdr_bool, &res, TIMEOUT) !=
    RPC_SUCCESS) {
    return (NULL);
    }
    return (&res);
    }
    *************** *************** *************** *************** *************** ***

    this old style is now considered obsolete.

    The problem is that this way VC++ considers the local parameters as
    being global variables instead of local; this results in the class tab
    of the workspace window being full of such wrong global variables.
    Do you know how can I tell the IDE to analyze correctly code of C
    old-style function definition?


    Thank you

    Luca
  • lallous

    #2
    Re: question about VC++ 6

    "Luca" <lcdll@libero.i t> wrote in message
    news:a97dd389.0 402060109.34c67 019@posting.goo gle.com...[color=blue]
    > Hi everybody, I have a little problem with Visual C++ 6.0
    > My project is a mixture of C and C++ code
    > I have many C functions whose definition follows the old-style, like
    > the following:
    >
    >[/color]
    *************** *************** *************** *************** *************** *
    **[color=blue]
    > bool_t *
    > datiambientalia uto_ntfy_1(argp , clnt)
    > RPCST_DATI_AMB_ AUTO_NTFY *argp;
    > CLIENT *clnt;
    > {
    > static bool_t res;
    >
    > bzero(&res, sizeof(res));
    > if (clnt_call(clnt , datiAmbientaliA uto_ntfy,
    > xdr_RPCST_DATI_ AMB_AUTO_NTFY, argp, xdr_bool, &res, TIMEOUT) !=
    > RPC_SUCCESS) {
    > return (NULL);
    > }
    > return (&res);
    > }
    >[/color]
    *************** *************** *************** *************** *************** *
    **[color=blue]
    >
    > this old style is now considered obsolete.
    >
    > The problem is that this way VC++ considers the local parameters as
    > being global variables instead of local; this results in the class tab
    > of the workspace window being full of such wrong global variables.
    > Do you know how can I tell the IDE to analyze correctly code of C
    > old-style function definition?
    >
    >
    > Thank you
    >
    > Luca[/color]

    You might want to try asking @ microsoft.publi c.vc.ide_genera l

    --
    Elias


    Comment

    • james

      #3
      Re: question about VC++ 6

      IDE can understand both C and C++ fully. I suppose you are familiar with C.
      because there are lots of fault of your post. one of major difference
      between C++ and C is Object feature. like as:
      ...Header file
      class Client
      {
      //data member
      .......
      //member function
      void bzero(int*res,i nt size);
      ........
      }
      //implement file
      Client *clnt= new Client;
      clnt->bzero(&res,siz eof(res));
      ......
      "Luca" <lcdll@libero.i t> ???
      news:a97dd389.0 402060109.34c67 019@posting.goo gle.com ???...[color=blue]
      > Hi everybody, I have a little problem with Visual C++ 6.0
      > My project is a mixture of C and C++ code
      > I have many C functions whose definition follows the old-style, like
      > the following:
      >
      >[/color]
      *************** *************** *************** *************** *************** *
      **[color=blue]
      > bool_t *
      > datiambientalia uto_ntfy_1(argp , clnt)
      > RPCST_DATI_AMB_ AUTO_NTFY *argp;
      > CLIENT *clnt;
      > {
      > static bool_t res;
      >
      > bzero(&res, sizeof(res));
      > if (clnt_call(clnt , datiAmbientaliA uto_ntfy,
      > xdr_RPCST_DATI_ AMB_AUTO_NTFY, argp, xdr_bool, &res, TIMEOUT) !=
      > RPC_SUCCESS) {
      > return (NULL);
      > }
      > return (&res);
      > }
      >[/color]
      *************** *************** *************** *************** *************** *
      **[color=blue]
      >
      > this old style is now considered obsolete.
      >
      > The problem is that this way VC++ considers the local parameters as
      > being global variables instead of local; this results in the class tab
      > of the workspace window being full of such wrong global variables.
      > Do you know how can I tell the IDE to analyze correctly code of C
      > old-style function definition?
      >
      >
      > Thank you
      >
      > Luca[/color]


      Comment

      • Default User

        #4
        Re: question about VC++ 6

        Luca wrote:
        [color=blue]
        > The problem is that this way VC++ considers the local parameters as
        > being global variables instead of local; this results in the class tab
        > of the workspace window being full of such wrong global variables.
        > Do you know how can I tell the IDE to analyze correctly code of C
        > old-style function definition?[/color]


        Are you trying to compile it as C or C++? Old style C function
        definitions are illegal in C++ and will need to be changed. Look into
        auto prototyping tools. If it is C code, then VC++ should handle it
        fine.




        Brian Rodenborn

        Comment

        Working...