Wednesday, March 31, 2010

comp.lang.c - 10 new messages in 6 topics - digest

comp.lang.c
http://groups.google.com/group/comp.lang.c?hl=en

comp.lang.c@googlegroups.com

Today's topics:

* 16:32 far pointers in OpenWatcom C/C++ - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/4728dadef590aafe?hl=en
* Consolidate Credit Card Debt - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/3849eae04df7b6b7?hl=en
* Implementing strstr - 5 messages, 2 authors
http://groups.google.com/group/comp.lang.c/t/a3fe05ab352d5774?hl=en
* Function definition (from standard) - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/3a7a0dcb4db91f23?hl=en
* c99 multidimensional arrays contiguous? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/3a16b9b33cb0cdd0?hl=en
* Error freeing memory.... - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/11d9ae8b83d16fe5?hl=en

==============================================================================
TOPIC: 16:32 far pointers in OpenWatcom C/C++
http://groups.google.com/group/comp.lang.c/t/4728dadef590aafe?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Mar 30 2010 7:13 pm
From: Jonathan de Boyne Pollard


>
>>
>> Which is why I didn't say "the reason". (-: It's worth thinking about
>> whether there now exist many mainstream processor architectures that
>> provide flat addressing where instruction set addresses are the same
>> width as, or narrower than, the general-purpose data registers, and
>> whether processor architectures that are even close to the I=L=P
>> model are not overwhelmingly in the minority. It's true for IA64 that
>> IS addresses are the same width as data registers (GR0 and IP being
>> both 64 bits wide). It's also true for the 68xx and the 680x0
>> architectures, that M. Flass was lamenting, earlier, to be rarities
>> these days, and no longer really part of the personal computer
>> market. It's certainly not the case for the x86 architecture (48-bit
>> CS:EIP being wider than 32-bit EAX).
>>
> is it possible to use 48-bit CS:EAX for point one big array of
> len=3FFF_FFFF_FFFF in one program?
>
Yes (assuming that you really mean something like DS:ESI), but no
operating system that I know of provides an execution environment like
that for applications, and the size would be smaller by the number of
non-value bits in a selector register, as well as by whatever selectors
were needed for other purposes. The pointers would be huge pointers. I
don't know off-hand whether OpenWatcom C/C++ supports 16:32 huge
pointers. (It and several other compilers support 16:16 huge pointers,
of course, as do several operating systems.) The way to overcome the
32-bit limitation of the linear address space, of course, is to remember
that before paging on x86 there was segment swapping. One just
invalidates all but one of the segments, and swaps segments on demand.
(Clever tricks with page tables can ameliorate the huge amount of I/O
that this would otherwise involve on every swap.) Again, this requires
operating system support that no operating system that I know of
provides. But for a freestanding program, such an idea is feasible.


==============================================================================
TOPIC: Consolidate Credit Card Debt
http://groups.google.com/group/comp.lang.c/t/3849eae04df7b6b7?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Mar 30 2010 8:38 pm
From: POOJA


Consolidate Credit Card Debt
------------------------------

http://sites.google.com/site/creditcarddebtconsolidation33

==============================================================================
TOPIC: Implementing strstr
http://groups.google.com/group/comp.lang.c/t/a3fe05ab352d5774?hl=en
==============================================================================

== 1 of 5 ==
Date: Tues, Mar 30 2010 8:54 pm
From: cri@tiac.net (Richard Harter)


On Tue, 30 Mar 2010 19:33:25 -0700 (PDT), spinoza1111
<spinoza1111@yahoo.com> wrote:

>On Mar 31, 6:14=A0am, c...@tiac.net (Richard Harter) wrote:
>> On Tue, 30 Mar 2010 10:46:57 -0700 (PDT),spinoza1111
>>
>> Just so. The problem, however, has nothing to do with automated
>> tools. Rather it lies in the choice of primitive constructs.
>> What B & J and the early enthusiasts did not immediately
>> recognize is that flow control constructs vary considerably in
>> power. The while loop/if-then-else combination is quite weak.
>
>This makes no sense, and the problem is the sloppy use of the word
>"power".

Would you prefer "strength" instead? If not that, would
"cornbread" do?


Richard Harter, cri@tiac.net
http://home.tiac.net/~cri, http://www.varinoma.com
It's not much to ask of the universe that it be fair;
it's not much to ask but it just doesn't happen.


== 2 of 5 ==
Date: Tues, Mar 30 2010 9:04 pm
From: spinoza1111


On Mar 31, 11:54 am, c...@tiac.net (Richard Harter) wrote:
> On Tue, 30 Mar 2010 19:33:25 -0700 (PDT),spinoza1111
>
> <spinoza1...@yahoo.com> wrote:
> >On Mar 31, 6:14=A0am, c...@tiac.net (Richard Harter) wrote:
> >> On Tue, 30 Mar 2010 10:46:57 -0700 (PDT),spinoza1111
>
> >> Just so. The problem, however, has nothing to do with automated
> >> tools. Rather it lies in the choice of primitive constructs.
> >> What B & J and the early enthusiasts did not immediately
> >> recognize is that flow control constructs vary considerably in
> >> power. The while loop/if-then-else combination is quite weak.
>
> >This makes no sense, and the problem is the sloppy use of the word
> >"power".
>
> Would you prefer "strength" instead? If not that, would
> "cornbread" do?  

What's wrong with truth? The problem is the authorized replacement of
the will to a collective truth by the celebration of a power which
only one person will get, and news flash: because none of you losers
will get any real power, you're damned fools for not rededicating
yourself to truth.

The truth of structured programming is that you can construct complex
devices in an understandable way with simple elements, scaling up.
"Power" has nothing to do with this. "Power" is getting other people
and machines to do your bidding against their will, and a gentleman is
bored with this type of "power".
>
> Richard Harter, c...@tiac.nethttp://home.tiac.net/~cri,http://www.varinoma.com
> It's not much to ask of the universe that it be fair;
> it's not much to ask but it just doesn't happen.

== 3 of 5 ==
Date: Tues, Mar 30 2010 9:57 pm
From: cri@tiac.net (Richard Harter)


On Tue, 30 Mar 2010 21:04:10 -0700 (PDT), spinoza1111
<spinoza1111@yahoo.com> wrote:

>On Mar 31, 11:54=A0am, c...@tiac.net (Richard Harter) wrote:
>> On Tue, 30 Mar 2010 19:33:25 -0700 (PDT),spinoza1111
>>
>> <spinoza1...@yahoo.com> wrote:
>> >On Mar 31, 6:14=3DA0am, c...@tiac.net (Richard Harter) wrote:
>> >> On Tue, 30 Mar 2010 10:46:57 -0700 (PDT),spinoza1111
>>
>> >> Just so. The problem, however, has nothing to do with automated
>> >> tools. Rather it lies in the choice of primitive constructs.
>> >> What B & J and the early enthusiasts did not immediately
>> >> recognize is that flow control constructs vary considerably in
>> >> power. The while loop/if-then-else combination is quite weak.
>>
>> >This makes no sense, and the problem is the sloppy use of the word
>> >"power".
>>
>> Would you prefer "strength" instead? If not that, would
>> "cornbread" do? =A0
>
>What's wrong with truth? The problem is the authorized replacement of
>the will to a collective truth by the celebration of a power which
>only one person will get, and news flash: because none of you losers
>will get any real power, you're damned fools for not rededicating
>yourself to truth.
>
>The truth of structured programming is that you can construct complex
>devices in an understandable way with simple elements, scaling up.
>"Power" has nothing to do with this. "Power" is getting other people
>and machines to do your bidding against their will, and a gentleman is
>bored with this type of "power".

Well I certainly am bored with your type of power.

In the mean time I will commend to you the thought that your
"truth of structured programming" may have some qualifiers.

Richard Harter, cri@tiac.net
http://home.tiac.net/~cri, http://www.varinoma.com
It's not much to ask of the universe that it be fair;
it's not much to ask but it just doesn't happen.


== 4 of 5 ==
Date: Tues, Mar 30 2010 11:12 pm
From: spinoza1111


On Mar 31, 12:57 pm, c...@tiac.net (Richard Harter) wrote:
> On Tue, 30 Mar 2010 21:04:10 -0700 (PDT),spinoza1111
>
>
>
>
>
> <spinoza1...@yahoo.com> wrote:
> >On Mar 31, 11:54=A0am, c...@tiac.net (Richard Harter) wrote:
> >> On Tue, 30 Mar 2010 19:33:25 -0700 (PDT),spinoza1111
>
> >> <spinoza1...@yahoo.com> wrote:
> >> >On Mar 31, 6:14=3DA0am, c...@tiac.net (Richard Harter) wrote:
> >> >> On Tue, 30 Mar 2010 10:46:57 -0700 (PDT),spinoza1111
>
> >> >> Just so. The problem, however, has nothing to do with automated
> >> >> tools. Rather it lies in the choice of primitive constructs.
> >> >> What B & J and the early enthusiasts did not immediately
> >> >> recognize is that flow control constructs vary considerably in
> >> >> power. The while loop/if-then-else combination is quite weak.
>
> >> >This makes no sense, and the problem is the sloppy use of the word
> >> >"power".
>
> >> Would you prefer "strength" instead? If not that, would
> >> "cornbread" do? =A0
>
> >What's wrong with truth? The problem is the authorized replacement of
> >the will to a collective truth by the celebration of a power which
> >only one person will get, and news flash: because none of you losers
> >will get any real power, you're damned fools for not rededicating
> >yourself to truth.
>
> >The truth of structured programming is that you can construct complex
> >devices in an understandable way with simple elements, scaling up.
> >"Power" has nothing to do with this. "Power" is getting other people
> >and machines to do your bidding against their will, and a gentleman is
> >bored with this type of "power".
>
> Well I certainly am bored with your type of power.

It's not a "type of power". It's the truth of a program.
>
> In the mean time I will commend to you the thought that your
> "truth of structured programming" may have some qualifiers.

...without specifying them.

"At University we learned that only Truth matters. At Mathematica,
Inc., we know that only Secrets matter."

This cheap Nietzcheanism against which Dijkstra struggled is self-
contradictory. For the same reason that Dweebach is to the wise a fool
when he says "that's a first year computer science problem" without
having taken a first or any year CS class, the truth-is-power boys
have to appeal to truth.

Slow and right is useful because true, but fast and wrong (what
machinists call scrap at high speeds) is useless. Computer operators
liked slow mainframe programs in the old days. It meant that they
could do their homework for school at the cute little Formica table
that the 360 had, or blaze up a joint, or drop acid (some mainframe
computer rooms allowed operators to smoke because the blowers were
said to get rid of the smoke particles).

But then, in the early 1980s, we all were given a presentation by IBM
on their new disk technology. It featured a spectacular picture of a
smoke particle versus a read head, where the read head was like a
Boeing 747 and the smoke particle a boulder on the runway. Poor read
head.

So we all stopped smoking (I had to start running marathons because
smoking is soooooo much fun).

The problem was that the message was that "machines are more important
than human labor and desire at all times and at all circumstances". Of
course, the personal computer was supposed to change that, and it did
for some people...but not for people for whom changing a screen saver
is a termination offense, and definitely not for people that have to
use Dweebach's code for changing %s to fuck-all, who have to watch
dully while it carries out this operation 10K times.

Basically, the field was overrun by thugs, the sort of thugs that
whenever they see truth want to change it back to power. Been going on
since the dawn of man, as seen in that film 2001.

Sure, my "truth" was that:

* Structured programming is cool.

* It could be extended to languages without control structures, by
putting numbered (not "meaningful" labels) on lines by themselves in
assembler, and separating these labels as in the code sample I gave
you when they belonged to different control structures.

In a letter in response to my 1976 article, the "structured
programming expert", a man who was commercializing structured
programming, Edward Yourdon, said that my notation did NOT constitute
"structured programming". He and others said that "structured
programming must be done in a language with control structures".

[I met Edward Yourdon five years later in the context of a job
interview. He wanted structured programming trainers to deliver
classes in Latin America. Should have taken his offer.]

But his view contradicted what was merely my own personal experience.
When, in 1971, I coded assembler with fallthrough, self-modifying
code, and other such practices, I could get a working and fast
program, but only by working longer hours.

This is why I think it is childish to use fallthrough and Duff's
stupid device in C. C supports Yourdon-style structured programming.
Having had the experience of debugging assembler programs (and one
[punched] card machine language programs that had to include their own
bootstrap loader and disk formatter), having been a REAL programmer
back when men were men, women were women and the sheep were nervous, I
am at best amused by wet behind the ears punks like Dweebach. But when
they start ruining reputations, that's when I get mad.
 
>
> Richard Harter, c...@tiac.nethttp://home.tiac.net/~cri,http://www.varinoma.com
> It's not much to ask of the universe that it be fair;
> it's not much to ask but it just doesn't happen.

== 5 of 5 ==
Date: Tues, Mar 30 2010 11:45 pm
From: spinoza1111


On Mar 31, 2:12 pm, spinoza1111 <spinoza1...@yahoo.com> wrote:
> On Mar 31, 12:57 pm, c...@tiac.net (Richard Harter) wrote:
>
>
>
>
>
> > On Tue, 30 Mar 2010 21:04:10 -0700 (PDT),spinoza1111
>
> > <spinoza1...@yahoo.com> wrote:
> > >On Mar 31, 11:54=A0am, c...@tiac.net (Richard Harter) wrote:
> > >> On Tue, 30 Mar 2010 19:33:25 -0700 (PDT),spinoza1111
>
> > >> <spinoza1...@yahoo.com> wrote:
> > >> >On Mar 31, 6:14=3DA0am, c...@tiac.net (Richard Harter) wrote:
> > >> >> On Tue, 30 Mar 2010 10:46:57 -0700 (PDT),spinoza1111
>
> > >> >> Just so. The problem, however, has nothing to do with automated
> > >> >> tools. Rather it lies in the choice of primitive constructs.
> > >> >> What B & J and the early enthusiasts did not immediately
> > >> >> recognize is that flow control constructs vary considerably in
> > >> >> power. The while loop/if-then-else combination is quite weak.
>
> > >> >This makes no sense, and the problem is the sloppy use of the word
> > >> >"power".
>
> > >> Would you prefer "strength" instead? If not that, would
> > >> "cornbread" do? =A0
>
> > >What's wrong with truth? The problem is the authorized replacement of
> > >the will to a collective truth by the celebration of a power which
> > >only one person will get, and news flash: because none of you losers
> > >will get any real power, you're damned fools for not rededicating
> > >yourself to truth.
>
> > >The truth of structured programming is that you can construct complex
> > >devices in an understandable way with simple elements, scaling up.
> > >"Power" has nothing to do with this. "Power" is getting other people
> > >and machines to do your bidding against their will, and a gentleman is
> > >bored with this type of "power".
>
> > Well I certainly am bored with your type of power.
>
> It's not a "type of power". It's the truth of a program.
>
>
>
> > In the mean time I will commend to you the thought that your
> > "truth of structured programming" may have some qualifiers.
>
> ...without specifying them.
>
> "At University we learned that only Truth matters. At Mathematica,
> Inc., we know that only Secrets matter."
>
> This cheap Nietzcheanism against which Dijkstra struggled is self-
> contradictory. For the same reason that Dweebach is to the wise a fool
> when he says "that's a first year computer science problem" without
> having taken a first or any year CS class, the truth-is-power boys
> have to appeal to truth.
>
> Slow and right is useful because true, but fast and wrong (what
> machinists call scrap at high speeds) is useless. Computer operators
> liked slow mainframe programs in the old days. It meant that they
> could do their homework for school at the cute little Formica table
> that the 360 had, or blaze up a joint, or drop acid (some mainframe
> computer rooms allowed operators to smoke because the blowers were
> said to get rid of the smoke particles).
>
> But then, in the early 1980s, we all were given a presentation by IBM
> on their new disk technology. It featured a spectacular picture of a
> smoke particle versus a read head, where the read head was like a
> Boeing 747 and the smoke particle a boulder on the runway. Poor read
> head.
>
> So we all stopped smoking (I had to start running marathons because
> smoking is soooooo much fun).
>
> The problem was that the message was that "machines are more important
> than human labor and desire at all times and at all circumstances". Of
> course, the personal computer was supposed to change that, and it did
> for some people...but not for people for whom changing a screen saver
> is a termination offense, and definitely not for people that have to
> use Dweebach's code for changing %s to fuck-all, who have to watch
> dully while it carries out this operation 10K times.
>
> Basically, the field was overrun by thugs, the sort of thugs that
> whenever they see truth want to change it back to power. Been going on
> since the dawn of man, as seen in that film 2001.
>
> Sure, my "truth" was that:
>
> *  Structured programming is cool.
>
> *  It could be extended to languages without control structures, by
> putting numbered (not "meaningful" labels) on lines by themselves in
> assembler, and separating these labels as in the code sample I gave
> you when they belonged to different control structures.
>
> In a letter in response to my 1976 article, the "structured
> programming expert", a man who was commercializing structured
> programming, Edward Yourdon, said that my notation did NOT constitute
> "structured programming". He and others said that "structured
> programming must be done in a language with control structures".
>
> [I met Edward Yourdon five years later in the context of a job
> interview. He wanted structured programming trainers to deliver
> classes in Latin America. Should have taken his offer.]
>
> But his view contradicted what was merely my own personal experience.
> When, in 1971, I coded assembler with fallthrough, self-modifying
> code, and other such practices, I could get a working and fast
> program, but only by working longer hours.
>
> This is why I think it is childish to use fallthrough and Duff's
> stupid device in C. C supports Yourdon-style structured programming.
> Having had the experience of debugging assembler programs (and one
> [punched] card machine language programs that had to include their own
> bootstrap loader and disk formatter), having been a REAL programmer
> back when men were men, women were women and the sheep were nervous, I
> am at best amused by wet behind the ears punks like Dweebach. But when
> they start ruining reputations, that's when I get mad.
>   
>
>
>
>
>
> > Richard Harter, c...@tiac.nethttp://home.tiac.net/~cri,http://www.varinoma.com
> > It's not much to ask of the universe that it be fair;
> > it's not much to ask but it just doesn't happen.

"I mentioned the non-competitive spirit explicitly, because these
days, excellence is a fashionable concept. But excellence is a
competitive notion, and that is not what we are heading for: we are
heading for perfection."

- Dijkstra

I recently saw my neighbor, Chow Yun Fat, star in Confucius, a
biography of the ancient Chinese philosopher. I was struck by a
strange parallel between Confucius' and Dijkstra's aphorisms.

The Master said, 'Is it not a pleasure, having learned something, to
try it out at due intervals? Is it not a joy to have friends come from
afar? Is it not gentlemanly not to take offence when others fail to
appreciate your abilities?

子曰學而時習之不亦說乎...

Like Confucius, Dijkstra was a humble advisor to the Duke of Burroughs
who sagely helped Burroughs conquer market share; by the time Dijkstra
left, most American and European banks were using Burroughs equipment,
which was based on stacks and Algol. But Dijsktra made many enemies
amongst the viziers of other princes, who took counsel amongst
themselves, saying, "this Dutch fuckwad is an ivory tower intellectual
whose code probably runs slowly, let us plot behind his back to take
his friends from him".

Therefore Dijkstra went to the Duke of Texas, who wanted to use him to
construct siege engines with which to conquer Alabama, but Dijkstra
shook his head, and asked to teach.

Yen Yüan asked about perfect virtue. The Master said, "To subdue one's
self and return to propriety, is perfect virtue. If a man can for one
day subdue himself and return to propriety, all under heaven will
ascribe perfect virtue to him. Is the practice of perfect virtue from
a man himself, or is it from others?"

Yen Yüan said, "I beg to ask the steps of that process." The Master
replied, "Look not at what is contrary to propriety; listen not to
what is contrary to propriety; speak not what is contrary to
propriety; make no movement which is contrary to propriety." Yen Yüan
then said, "Though I am deficient in intelligence and vigor, I will
make it my business to practice this lesson."

顏淵問仁子曰克己復禮為仁一日克己復禮...

And a student asked Dijkstra, why is it, Master, you write with pen
and ink that you make yourself? Let me teach you Microsoft Word.

Dijkstra admonished his pupil, saying, whilst I carve the pen I think
about the proof of my algorithm. Whilst I grind the ink I think of
counterexamples. Then as I write I never have to blot a line, or use
the Paper that is Liquid. At all times my mind is focused on
proprieties, whereas when I use Microsoft Word, and I click and image
to make it fit the page tightly, my mind is distracted, for the image
pops to the top of the page.

From this, I pass into a rage, and throw my computer across the room.
My mind is no longer thinking of the proprieties.

==============================================================================
TOPIC: Function definition (from standard)
http://groups.google.com/group/comp.lang.c/t/3a7a0dcb4db91f23?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Mar 30 2010 11:08 pm
From: Sensei


On 2010-03-23 20:20:10 +0100, Ben Pfaff <blp@cs.stanford.edu> said:

> Sensei <sensei.wa@apple.me.com> writes:
>
>> AFAIR, "f()" accepts an undefined number of parameters, although I
>> fail to see the place where this is equivalent to a variable number of
>> arguments.
>
> The two are not equivalent. C99 requires functions to be
> declared before they are invoked. A function that accepts a
> variable number of arguments must be declared with a prototype,
> because a function declared without a prototype is not compatible
> with one declared with an ellipsis terminator. See section
> 6.7.5.3 "Function declarators (including prototypes)":
>
> Moreover, the parameter type lists, if both are present,
> shall agree in the number of parameters and in use of the
> ellipsis terminator; corresponding parameters shall have
> compatible types. If one type has a parameter type list
> and the other type is specified by a function declarator
> that is not part of a function definition and that contains
> an empty identifier list, the parameter list shall not have
> an ellipsis terminator and the type of each parameter shall
> be compatible with the type that results from the
> application of the default argument promotions.


So, is the following call illegal, and in case, how are the parameters
handled as specified by the standard? Are they simply discarded?

int f ( ) { return 0; }

/* ... */
printf( "zero parameters = %d\n", f() );

printf( "some parameters = %d\n", f(1, 2.1234, "hello") );

Moreover, I know that main should either declared as main(void) or
main(int argc, char *argv[] ), but what does it mean (always as for the
standard) regarding its parameters?

Thanks for clarifying!

--

Sensei�<Sensei's e-mail is at Me-dot-com>

We know Linux is the best, it can do infinite loops in five seconds.
(Linus Torvalds)


==============================================================================
TOPIC: c99 multidimensional arrays contiguous?
http://groups.google.com/group/comp.lang.c/t/3a16b9b33cb0cdd0?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Mar 30 2010 11:55 pm
From: David Thompson


On 16 Mar 2010 16:28:33 GMT, Seebs <usenet-nospam@seebs.net> wrote:

> On 2010-03-16, pemo <peet.morris@gmail.com> wrote:
> > Maybe this was in a nightmare, but I seem to remember reading
> > something that said in C99 multidimensional arrays *need not* be laid
> > out contiguously in memory, i.e., that one should not treat them as a
> > single contiguous blob of memory!
>
> > Was this just a bad dream of mine please??
>
> Sorta yes, sorta no.
>
> 1. They must indeed be laid out contiguously in memory.
> 2. If you derive a pointer from one of the sub-arrays, you should not
> then try to derive pointers outside that sub-array from it.
>
And it's not clear if you meant this to be important to your question,
but this is not new in C99 -- the same was true in C89. Before that,
you always had contiguity (back to 'prehistory' in dmr's terms)
and de facto usually had 'all pointer arithmetic works' based on
the B heritage of a single flat address-space.


==============================================================================
TOPIC: Error freeing memory....
http://groups.google.com/group/comp.lang.c/t/11d9ae8b83d16fe5?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Mar 30 2010 11:55 pm
From: David Thompson


On 14 Mar 2010 18:09:33 GMT, Seebs <usenet-nospam@seebs.net> wrote:

> On 2010-03-14, Sheldon <shejo284@gmail.com> wrote:
> > I have a fairly large program that has a problem that I cannot seem to
> > solve.
> > The program runs smoothly but when it tries to free allocated memory
> > before exiting I get a segmentation fault.
<snip>
> A thousand lines isn't all that much. A couple thoughts:
>
> 1. Go through removing functional code to strip it down. If you find
> that, after removing something, you suddenly don't have a problem, then
> that code is what did it.

Warning: If it's a memory clobber bug, removing some (good) code that
doesn't contain the bug may merely hide the symptom(s) because the
clobber moves to a different place that doesn't (currently) matter, or
disguise them because the clobber only causes slightly wrong output
rather than a crash. For example if it now damages your PRNG and
(only) causes the output to be less random than it should, you have
practically no chance of noticing that by looking at output. This can
mislead you into looking at the good code for a bug that isn't there.
You may need to test a whole lattice of cuts to find, with any
confidence, which ones actually remove the problem.

> 2. Once you get it stripped down, it should be a lot shorter.
>
That's true. If you are able to find a small(er) version that DOES
still have the symptom, you have a smaller haystack to deal with.

> My guess would be that you're overrunning something -- allocating the
> wrong size of space. The last time I had this, I'd allocated enough space
> for a pointer, rather than enough space for the thing pointed to...
>
As others have said, the easiest way to look for this is one of the
several tools that actually checks for overruns. I don't know which
(or if any) also catch wild or stale pointers, though.

==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.c"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.c?hl=en

To unsubscribe from this group, send email to comp.lang.c+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate