[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: BeOS PPC Compilation Fixes

From: Greg Stein <gstein_at_lyra.org>
Date: 2000-12-03 10:57:44 CET

On Sun, Dec 03, 2000 at 03:39:12AM -0600, Sam TH wrote:
> On Sun, Dec 03, 2000 at 01:26:28AM -0800, Greg Stein wrote:
> >
> > Looks like Ryan is offline, so I'll go and commit the isascii fix. I'm not
> > sure on the include header stuff, though, so I'm going to pass that one up.
>
> Well, if you look at socket.c, it really does include sa_common.c, but
> you're welcome to wait.

Ah. We've been looking at header files. I'm updating my APR right now and
will take a closer look in a sec.

>...
> > > --include-deps removes the gcc dependency generation command, which
> > > other compilers understandably don't like.
> >
> > I think we're going to need a different solution.
>
> Your suggestion being? What ways are there to do this properly?

misfire. I started to write stuff there, but wanted to pull up the web-book
on automake to look up some stuff. Got distracted, completed the mail, and
sent it.

I'm not sure what the right answer is currently. For people using GCC, we
still want the deps. But yes: we also need to work for non-GCC users...

>...
> > Needing a cast invariably means that something *else* is wrong. Adding a
> > cast is a almost always band-aid which does not solve the underlying
> > problem.
> >
> > That said: your patch points out where some problems exist, and we can solve
> > those properly.
>
> Well, I didn't want to go around changing other peoples' interfaces,
> but that is better.

It is the only solution in my mind :-)

>...
> > Now that is just a dumb compiler if it is complaining about those. "char *"
> > can legally be passed to a "const char *" function. The other possibility is
> > that it doesn't think that "char foo[]" is compatible with "char *foo" --
> > again, a big problem with the compiler.
> >
> > [ I believe both of those issues are consider "standard C" and we shouldn't
> > "have" to cast. ]
> >
> > Which of the two problems is the compiler talking about? const or [] ?
>
> The problem is with the const. I couldn't find anything about the
> standard either way in a quick Google search.

Urk. That is really bad. I'm surprised you aren't seeing more widespread
problems. The rule is pretty simple:

    void foo(const char *bar)

You can pass a "const char *baz" or a "char *baz" to the above function.
Both values are "char *" and the function says "I won't modify it."

We aren't in a position to retrofit the whole codebase to insert casts to
include "const" to compensate for a poor compiler. All of those casts would
end up hiding a typing bug at some point in the future (which is why I hate
casts).

> > I'm compiling the changes now and will check in soon.
>
> When you do, I'll test it, although if those other things (like the
> deps files) don't change, there's not much point.

The cast stuff is in, and I'm looking at the other bits now.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
Received on Sat Oct 21 14:36:16 2006

This is an archived mail posted to the Subversion Dev mailing list.