Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-21 Thread Joerg Schilling
Stephen Hahn <[EMAIL PROTECTED]> wrote: > > This reminds me of to ask when code review will be possible by people > > from outsude Sun. > > Can you be more specific about what kind of code review actions you > mean? For instance, wearing my RTI advocate hat, I would probably > accept RTI s

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-21 Thread James Carlson
Joerg Schilling writes: > > That would mean "the strchr function takes a pointer to character > > argument, it does not modify the storage pointed to, and the value it > > returns has the same storage qualifiers as the first argument." > > If the #pragma only affects the storage attributes (as I i

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-21 Thread Joerg Schilling
James Carlson <[EMAIL PROTECTED]> wrote: > > >typeof(arg1) > > >strchr(const char *, char) > > > > > >or something similar that would carry the actual input over to the return > > >value. > > > > > > It would soon give you C++ type overloading. Might not be bad, but you > > know where to find

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-21 Thread James Carlson
[EMAIL PROTECTED] writes: > >typeof(arg1) > >strchr(const char *, char) > > > >or something similar that would carry the actual input over to the return > >value. > > > It would soon give you C++ type overloading. Might not be bad, but you > know where to find C++ :-) A good subset of the func

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-21 Thread Casper . Dik
>The question would be if the C standard commitee could define something like >this: > >typeof(arg1) >strchr(const char *, char) > >or something similar that would carry the actual input over to the return >value. It would soon give you C++ type overloading. Might not be bad, but you know whe

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-21 Thread Joerg Schilling
[EMAIL PROTECTED] wrote: > The C standards folks aren't that stupid. The function should not > have their return values const qualified because in the majority > of cases: > - the argument isn't const > - the return value is going to be modified. > > The const qualifier for the argume

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-21 Thread Casper . Dik
>Yes, there are a number of standard library and system functions which >could or should have their return types const-qualified but don't. >Historical and conformance reasons, of course, but it makes >-Wwrite-strings and similar options rather useless. The C standards folks aren't that stupid.

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-20 Thread Dan Price
On Mon 20 Mar 2006 at 03:24PM, Stephen Lau wrote: > Joerg Schilling wrote: > >> "The list of code reviewers should be individuals who have > >> actually reviewed the code, not an alias for a group of people who > >> were given the opportunity to do so." > > > > > >This reminds me of to ask wh

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-20 Thread Stephen Lau
Joerg Schilling wrote: "The list of code reviewers should be individuals who have actually reviewed the code, not an alias for a group of people who were given the opportunity to do so." This reminds me of to ask when code review will be possible by people from outsude Sun. Dan Pri

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-20 Thread Stephen Hahn
* Joerg Schilling <[EMAIL PROTECTED]> [2006-03-20 13:36]: > Keith M Wesolowski <[EMAIL PROTECTED]> wrote: > > "The list of code reviewers should be individuals who have > > actually reviewed the code, not an alias for a group of people who > > were given the opportunity to do so." > >

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-20 Thread Keith M Wesolowski
On Mon, Mar 20, 2006 at 10:36:23PM +0100, Joerg Schilling wrote: > If you really like to use const char *, then it may needed to change thousands > of lines. And even then you would not find: Yes, I understand. I wasn't suggesting to change the code but rather to examine it. In most cases, larg

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-20 Thread Joerg Schilling
Keith M Wesolowski <[EMAIL PROTECTED]> wrote: > No one said you have to manually test every possible input to every > possible program. In many cases you may be able to use semi-automated > means to rule out a need for any manual testing at all (for example, > if you can show that every reference

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-20 Thread Joerg Schilling
Keith M Wesolowski <[EMAIL PROTECTED]> wrote: > bugs of this type. I believe the printing system (cmd/lp) in > particular is actually using -fwritable-strings in a few places still, > so it would definitely break with -xstrconst. Is there no way to modify the related code to work with -xstrconst

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-18 Thread Eric Enright
On 3/18/06, Keith M Wesolowski <[EMAIL PROTECTED]> wrote: > On Sat, Mar 18, 2006 at 09:31:27PM +0100, Roland Mainz wrote: > > > Ouch... every single binary with all possible combinations of input ? > > That's almost impossible for a single person .. ;-( > > No one said you have to manually test eve

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-18 Thread Roland Mainz
[EMAIL PROTECTED] wrote: > >Are there any bug reports in the gcc bugzilla for that ? > > I can't tell what versions exhibited these issues and whther these > were fixed; they were certainly well known at some point. I recall some trouble in the gcc2.9x.x days... but do the problems apply to gcc4.

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-18 Thread Keith M Wesolowski
On Sat, Mar 18, 2006 at 09:31:27PM +0100, Roland Mainz wrote: > Ouch... every single binary with all possible combinations of input ? > That's almost impossible for a single person .. ;-( No one said you have to manually test every possible input to every possible program. In many cases you may

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-18 Thread Casper . Dik
>Are there any bug reports in the gcc bugzilla for that ? I can't tell what versions exhibited these issues and whther these were fixed; they were certainly well known at some point. >> Doesn't gcc -fwritable-strings work? > >Erm... I think this would be the wrong way. C/C++ string literals are

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-18 Thread Roland Mainz
Keith M Wesolowski wrote: > On Sat, Mar 18, 2006 at 08:35:51PM +0100, Roland Mainz wrote: > > Are there any objections that I make a patch which simply adds > > "-xstrconst" to the tree-wide compile options ? > > Not at all; I'd welcome it, provided - and this is a big catch - that > you can demon

Re: "-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-18 Thread Keith M Wesolowski
On Sat, Mar 18, 2006 at 08:35:51PM +0100, Roland Mainz wrote: > Are there any objections that I make a patch which simply adds > "-xstrconst" to the tree-wide compile options ? Not at all; I'd welcome it, provided - and this is a big catch - that you can demonstrate that you've achieved the neces

"-xstrconst" patch / was: Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-18 Thread Roland Mainz
Keith M Wesolowski wrote: > On Sat, Mar 18, 2006 at 09:29:35AM +0100, [EMAIL PROTECTED] wrote: > > > Doesn't gcc -fwritable-strings work? > > Yes, in gcc 3. However it issues a warning about deprecation, and in > gcc 4 the option is gone entirely. Are there any objections that I make a patch wh

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-18 Thread Roland Mainz
[EMAIL PROTECTED] wrote: > > >> Note that when building ON with gcc, we use -fno-builtin. > > > >Why ? I understand this is usefull for debugging - but it kills some > >interesting opportunities for optimisation... ;-( > > Gcc builtins were often buggy (expected alignment were none was > guarante

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-18 Thread Keith M Wesolowski
On Sat, Mar 18, 2006 at 09:29:35AM +0100, [EMAIL PROTECTED] wrote: > Doesn't gcc -fwritable-strings work? Yes, in gcc 3. However it issues a warning about deprecation, and in gcc 4 the option is gone entirely. -- Keith M Wesolowski "Sir, we're surrounded!" Solaris Kernel Team

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-18 Thread Casper . Dik
>> Note that when building ON with gcc, we use -fno-builtin. > >Why ? I understand this is usefull for debugging - but it kills some >interesting opportunities for optimisation... ;-( Gcc builtins were often buggy (expected alignment were none was guaranteed) or called functions which don't exis

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-17 Thread Keith M Wesolowski
On Sat, Mar 18, 2006 at 12:54:36AM +0100, Roland Mainz wrote: > Is there no way to use gcc's builtin functions except those which should > be handled by the platform-optimized libc ? Using -fno-builtin is like > hunting ducks with a Abrahams tank... Yes, you can say -fno-builtin-. Unfortunately

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-17 Thread Roland Mainz
Keith M Wesolowski wrote: > On Fri, Mar 17, 2006 at 11:53:30PM +0100, Roland Mainz wrote: > > > Note that when building ON with gcc, we use -fno-builtin. > > > > Why ? I understand this is usefull for debugging - but it kills some > > interesting opportunities for optimisation... ;-( > > While I'

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-17 Thread Keith M Wesolowski
On Fri, Mar 17, 2006 at 11:53:30PM +0100, Roland Mainz wrote: > > Note that when building ON with gcc, we use -fno-builtin. > > Why ? I understand this is usefull for debugging - but it kills some > interesting opportunities for optimisation... ;-( While I'm not the one who implemented this, I'

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-17 Thread Roland Mainz
Jonathan Adams wrote: > On Fri, Mar 17, 2006 at 11:15:40PM +0100, Roland Mainz wrote: > > Is there any RFE yet which asks to compile the whole kernel+tools with > > "-xstrconst -xbuiltin=%all" to improve the footprint a little bit for > > Sun Forte/Workshop/Studio builds (I've checked the bug datab

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-17 Thread Roland Mainz
Keith M Wesolowski wrote: > On Fri, Mar 17, 2006 at 11:15:40PM +0100, Roland Mainz wrote: > > Is there any RFE yet which asks to compile the whole kernel+tools with > > "-xstrconst -xbuiltin=%all" to improve the footprint a little bit for > > Sun Forte/Workshop/Studio builds (I've checked the bug d

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-17 Thread Jonathan Adams
On Fri, Mar 17, 2006 at 11:15:40PM +0100, Roland Mainz wrote: > Is there any RFE yet which asks to compile the whole kernel+tools with > "-xstrconst -xbuiltin=%all" to improve the footprint a little bit for > Sun Forte/Workshop/Studio builds (I've checked the bug database but > couldn't find anythi

Re: [osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-17 Thread Keith M Wesolowski
On Fri, Mar 17, 2006 at 11:15:40PM +0100, Roland Mainz wrote: > Is there any RFE yet which asks to compile the whole kernel+tools with > "-xstrconst -xbuiltin=%all" to improve the footprint a little bit for > Sun Forte/Workshop/Studio builds (I've checked the bug database but > couldn't find anyth

[osol-discuss] Footprint: Compiling kernel+tools with "-xstrconst -xbuiltin=%all"

2006-03-17 Thread Roland Mainz
Hi! Is there any RFE yet which asks to compile the whole kernel+tools with "-xstrconst -xbuiltin=%all" to improve the footprint a little bit for Sun Forte/Workshop/Studio builds (I've checked the bug database but couldn't find anything matching... ;-( ) ? gcc already does the same by defaul