[wplug] C compiling question
James O'Kane
jo2y at midnightlinux.com
Tue Oct 1 21:09:27 EDT 2002
I'm often too abstract when I ask questions like this, but I never know in
which way. If people want to look at what I'm talking to, I refer you to:
http://www.snert.org/Software/mod_throttle/mod_throttle312.tgz
Pick any "== true" statement in there.
I think what I was asking was, did the semantics of == ever change with
respect to pointers in recent revisions of gcc? Perhaps they added
something that made this work, and then took it back out.
I want to make sure I have my arguement straight before I email the guy
with a patch.
Most of the == stuff is related to ap_table_set and ap_table_get, which
are used by apache to pass notes between requests and processes, I think.
My current theory is that the implimentation of those functions has
changed and it breaks this code. Before it would save the &true, while
currently it copies it the value of true. This I have not verified yet,
but seems plausible.
He something like this in line 3076:
r->handler = throttle_remote_user_str;
And then on line 3634:
if (r->handler == throttle_remote_user_str) {
Declaration of throttle_remote_user_str:
static const char throttle_remote_user_str[] = "throttle-remote-user"
It seems like it would save the address of throttle_remote_user_str into
r->handler, and then line 3634 it is comparing two pointers.
This is packaged along with Red Hat 7.3, so I'm concluding that this must
have worked in some fashion at some point. Without me adding any changes,
I've found that the if in 3634 is never true, and it should be. gdb
confirms that. If I change the == to a strcmp, it works as it should.
How can this have made it into 'production' code when the whole
functionality of this modules doesn't work as is.
-james
More information about the wplug
mailing list