Re: How to test whether strstr() returns a null pointer or not?
- From: "Malcolm" <regniztar@xxxxxxxxxxxxxx>
- Date: Sun, 5 Jun 2005 08:24:00 +0000 (UTC)
"Keith Thompson" <kst-u@xxxxxxx> wrote
>
>>>> A window popped up asking for permission to report the problem to
>>>> Microsoft. That's how I knew something was wrong. Anyway, since
>>>> the program is working now, I'll just leave the mistery behind and
>>>> forget about it.
>>>
>>> It's very likely that the error was a symptom of a deeper problem
>>> that's going to bite you again later on. The change you made should
>>> not have made any difference. It's up to you whether you want to
>>> spend time tracking it down, but I'd advise doing so.
>>>
>> The bug is in the compiler. That's why MS want a bug report.
>
> Is it? Does the "report the problem to Microsoft" message reliably
> indicate a bug in Microsoft's compiler, or could it be triggered by a
> bug in the program itself? (I have no idea what the answer to that
> question is.)
>
A bit OT, but yes.
Microsoft aren't interested if a developer has introduced a bug into his
program, except that obviously the compiler produces a diagnostic if
possible.
However they are interested if their own compiler / ide / debugger isn't
working. The message indicates that their program has encountered an
internal error, i.e. is bugged. (If it wasn't bugged before it popped up the
message box, it is bugged after).
That bug could be triggered by attempting to compile a legal program, or it
could be triggered by an illegal program. Either way it is Microsoft's
fault.
>
> If it's the result of undefined behavior in the program, recompiling
> with another compiler coud very well *seem* to correct the problem.
>
What I should have asked if whether the message appears at compile time or
run time. If it appears when the program is run under the debugger it is
probably a bug in the debugger rather than the compiler itself. It could
indeed be because the debugger cannot cope with undefined behaviour.
You are right that compiling on another compiler may mask the error. Once
your tool stop working reliably it is hard to know what to do.
.
- References:
- How to test whether strstr() returns a null pointer or not?
- From: John Smith
- Re: How to test whether strstr() returns a null pointer or not?
- From: Barry Schwarz
- Re: How to test whether strstr() returns a null pointer or not?
- From: John Smith
- Re: How to test whether strstr() returns a null pointer or not?
- From: Barry Schwarz
- Re: How to test whether strstr() returns a null pointer or not?
- From: John Smith
- Re: How to test whether strstr() returns a null pointer or not?
- From: Keith Thompson
- Re: How to test whether strstr() returns a null pointer or not?
- From: Malcolm
- Re: How to test whether strstr() returns a null pointer or not?
- From: Keith Thompson
- How to test whether strstr() returns a null pointer or not?
- Prev by Date: Re: Any quick reference for the difference between C and C++
- Next by Date: Re: Bit twiddling
- Previous by thread: Re: How to test whether strstr() returns a null pointer or not?
- Next by thread: Re: How to test whether strstr() returns a null pointer or not?
- Index(es):
Relevant Pages
|
Loading