January 24, 2004
>> Don't even know what it is...
>In the IDDE you are able to set the option for (C) function prototyping,
>a missing prototype will be automagically added on first use/call of the
>function.
>IDDE: See project -> Setting -> Build-tab -> Prototype
>CMDline -p-

I hadn't even noticed that option... No, in fact, I had set it to 'strict'.


January 25, 2004
Speaking of reading carefully, maybe you should carefully reread my message. I never disagreed that the error message is misleading or inaccurrate. Unless you can track down where "count" is declared, the only other explanation is a misleading error message.

Having built a compiler or two before I came back to gradual school, I know how easy it is for a compiler to generate a bad, inaccurrate, inoperative, misleading, outright incorrect error message.

Proove me wrong and find where "count" is declared as a variable and buttress your assertion.


-scooter

dan wrote:

>>There may be another template whose third param is an unsigned long; in the absense of any other information, DMC++ is assuming that the closest matching template is the one whose third param is an unsigned long. That'd be my guess.
> 
> No, look at the message again:  My function expected a pointer to an
> unsigned
> long, but I forgot to declare "unsigned long count".  So, what would the
> compiler normally do?  It would say "count not declared".  *Instead*, it
> says that it cannot convert "count", in whatever screwey way it IS ALREADY
> DEFINED SOMEWHERE, to a pointer to an unsigned long.
> 
> But why should there be ANYTHING named "count"?!?!... especially in global space!!!  Maybe "____COUNT____", but not "count"!!!
> 
> Cheers!

January 26, 2004
In article <bv1aoo$j4j$1@digitaldaemon.com>, Scott Michel says...
>
>Speaking of reading carefully, maybe you should carefully reread my message. I never disagreed that the error message is misleading or inaccurrate. Unless you can track down where "count" is declared, the only other explanation is a misleading error message.

Sorry, wouldn't have thought of a misleading error message, yet I don't see where were you suggesting that in your message;  but maybe I'm misreading it. You mentioned a template foulup leading to expecting a pointer to a long;  but what I was trying to say is that my function already expects a pointer to a long, so there's no need to find *why* a ptr to long would be needed. It's supposed to be needed.  It's not that I passed a pointer to long by accident, but rather that I was passing a pointer to a long called "count" which I never declared. Anyways, I changed the name to "coun", and declared it, and everything's running smoothly. But I thought I'd report the fact that someone or something is apparently declaring something called "count".

>Having built a compiler or two before I came back to gradual school, I know how easy it is for a compiler to generate a bad, inaccurrate, inoperative, misleading, outright incorrect error message.
>
>Proove me wrong and find where "count" is declared as a variable and buttress your assertion.

Hmm, wouldn't know where to start, and I'm really behind schedule with my project. I guess I'll prove you wrong in a week or two... ;-)


January 26, 2004
dan wrote:
> Sorry, wouldn't have thought of a misleading error message, yet I don't
> see
> where were you suggesting that in your message;  but maybe I'm misreading
> it.
> You mentioned a template foulup leading to expecting a pointer to a long;
> but what I was trying to say is that my function already expects a pointer
> to a long, so there's no need to find *why* a ptr to long would be needed.
> It's
> supposed to be needed.  It's not that I passed a pointer to long by
> accident, but rather that I was passing a pointer to a long called "count"
> which I never declared. Anyways, I changed the name to "coun", and
> declared it, and everything's running smoothly. But I thought I'd report
> the fact that someone or something is apparently declaring something
> called "count".

There are a few places in STLport where a "count" occurs, using the magic of Cygwin utilities and "grep -n -r count stlport | grep -v _count":

stl/_algo.h, line 125
stl/_algobase.h, line 524
stl/_fstream.h, line 113
stl/_hashtable.h, line 501
stl/_hash_map.h, lines 191, 380
stl/_hash_set.h, lines 191, 388

You're not seeing a misleading error message. It's the compiler trying to match up a template function named "count" that counts the number of elements between two iterators, first and list, that match a particular value.

You might want to go off an have a word with the HP and SGI STL folks, as well as the STLport folks for having a template function named "count".

Finding this wasn't that hard. :-)


-scooter
January 26, 2004
>You might want to go off an have a word with the HP and SGI STL folks, as well as the STLport folks for having a template function named "count".

I'll report it to stlport; thanks!

>Finding this wasn't that hard. :-)

Newbie here ;-)


January 27, 2004
dan wrote:

>>You might want to go off an have a word with the HP and SGI STL folks, as well as the STLport folks for having a template function named "count".
> 
> I'll report it to stlport; thanks!
> 
>>Finding this wasn't that hard. :-)
> 
> Newbie here ;-)

I don't think you want to be too hasty on that report. The count template
function is actually a feature. :-) :-) :-)


-scooter
January 28, 2004
"Scott Michel" <scottm@cs.ucla.edu> wrote in message news:bv4qs9$9cu$1@digitaldaemon.com...
> I don't think you want to be too hasty on that report. The count template
> function is actually a feature. :-) :-) :-)


I have a lot of experience tracking down strange problems happening with vast, over complicated, excessively interrelated, layered huge masses of source code. It just never works to guess at what is going on. The only thing to do is to follow the advice at www.digitalmars.com/faq.html#error and www.digitalmars.com/bugs.html

There really isn't any other way that works.


1 2
Next ›   Last »