Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #107887

Re: Need help fixing a "previously defined" error

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: Need help fixing a "previously defined" error
Date 2017-04-08 20:03 +0100
Organization A noiseless patient Spider
Message-ID <87a87qu3gm.fsf@bsb.me.uk> (permalink)
References <20170408-130720.9.0@Peabody.ssl.astraweb.com> <ocat16$nro$1@dont-email.me> <20170408-175108.70.0@Peabody.ssl.astraweb.com>

Show all headers | View raw


Peabody <waybackNO584SPAM44@yahoo.com> writes:
<snip>

> Ok, but what's confusing me is that "StrTrim" is a legit
> Microsoft string function, although possibly (only) for C++:
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/bb773454
> (v=vs.85).aspx

C (and C++) are case-sensitive so that's not the same function at all.

> So is this just a mistake - the wrong case chosen for the
> letters - and TI is really trying to call the MS
> function to trim a string?

The code you posted is not calling the function (i.e. using it) it is
merely declaring it -- in this case, telling the compiler what the
arguments types to expect and what type the return value has.

Almost certainly there will be at least other uses of that name.  One
will a definition of the function and another will be a call to it.  Of
course, there may be many calls but there should be only one definition.

> But what string would that be?
> "lpszA" doesn't appear anywhere else in the source code
> either, but I think it also has some kind of special meaning
> involving Unicode.

It's fake name.  A declaration does not need to name the arguments but
people often put one in to "help out" or sometimes the first line of the
function definition (which does need names) is copied to make the
declaration.  One way or another all of these are the same:

  char* strtrim(char* lpszA);
  char* strtrim(char*);
  char* strtrim(char* string);
  char* strtrim(char* long_pointer_to_start_of_zero_terminated_ASCII_string);

That last one is a guess at what "lpszA" is suppose to convey to those
who have been initiated (or indoctrinated) into the cabal.

<snip>
-- 
Ben.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-08 08:07 -0500
  Re: Need help fixing a "previously defined" error James Kuyper <jameskuyper@verizon.net> - 2017-04-08 10:47 -0400
    Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-08 12:51 -0500
      Re: Need help fixing a "previously defined" error Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-04-08 20:03 +0100
      Re: Need help fixing a "previously defined" error Spiros Bousbouras <spibou@gmail.com> - 2017-04-08 19:06 +0000
      Re: Need help fixing a "previously defined" error James Kuyper <jameskuyper@verizon.net> - 2017-04-08 15:17 -0400
  Re: Need help fixing a "previously defined" error Spiros Bousbouras <spibou@gmail.com> - 2017-04-08 15:29 +0000
  Re: Need help fixing a "previously defined" error Barry Schwarz <schwarzb@dqel.com> - 2017-04-08 09:21 -0700
    Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-08 13:04 -0500
      Re: Need help fixing a "previously defined" error James Kuyper <jameskuyper@verizon.net> - 2017-04-08 15:33 -0400
        Re: Need help fixing a "previously defined" error Spiros Bousbouras <spibou@gmail.com> - 2017-04-08 19:51 +0000
        Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-08 16:24 -0500
    Re: Need help fixing a "previously defined" error Keith Thompson <kst-u@mib.org> - 2017-04-08 18:45 -0700
  Re: Need help fixing a "previously defined" error bartc <bc@freeuk.com> - 2017-04-08 17:46 +0100
    Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-08 13:19 -0500
  Re: Need help fixing a "previously defined" error David Brown <david.brown@hesbynett.no> - 2017-04-09 12:38 +0200
    Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-09 07:52 -0500
      Re: Need help fixing a "previously defined" error David Brown <david.brown@hesbynett.no> - 2017-04-09 17:02 +0200
        Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-09 18:20 -0500
          Re: Need help fixing a "previously defined" error James Kuyper <jameskuyper@verizon.net> - 2017-04-09 22:06 -0400
          Re: Need help fixing a "previously defined" error David Brown <david.brown@hesbynett.no> - 2017-04-10 09:07 +0200
            Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-10 09:11 -0500
              Re: Need help fixing a "previously defined" error David Brown <david.brown@hesbynett.no> - 2017-04-10 17:31 +0200
                Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-10 12:48 -0500

csiph-web