Re: free (static_array)

2008-07-01 Thread Denys Vlasenko
On Tuesday 01 July 2008 08:38, Sajish V wrote: > Hi All, > Can you please let me know why GCC does not crib when we try to free a static > array? > main () > { > char array[100]; > free (array); > } > The above code compiles without any hitch. > Thanks, > Sajish. # ./a.out *** glibc

Re: free (static_array)

2008-07-01 Thread Sajish V
Thanks for the reply, Denys. My question was, why doesn't gcc catch it during compilation? It is clear that we are trying to free a variable from stack. Shouldn't gcc flag an error for this during compilation? Regards, Sajish. - Original Message From: Denys Vlasenko <[EMAIL PROTECTED]

Re: Feature request - a macro defined for GCC

2008-07-01 Thread Denys Vlasenko
On Tuesday 01 July 2008 07:33, x z wrote: > > I would like to see that GCC define a macro in the case it is being used to > compile a program. Currently there is a __GNUC__ macro defined by the GNU C > preprocessor CPP. That does not suit the need. As the CPP Manual says: > __GNUC__ is "defin

Re: free (static_array)

2008-07-01 Thread Denys Vlasenko
On Tuesday 01 July 2008 09:24, Sajish V wrote: > Thanks for the reply, Denys. > My question was, why doesn't gcc catch it during compilation? It is clear > that we are trying to free a variable from stack. Shouldn't gcc flag an error > for this during compilation? How gcc can know that free() is

Re: Feature request - a macro defined for GCC

2008-07-01 Thread Andrew Haley
x z wrote: > I would like to see that GCC define a macro in the case it is being > used to compile a program. Currently there is a __GNUC__ macro > defined by the GNU C preprocessor CPP. That does not suit the need. > As the CPP Manual says: __GNUC__ is "defined by all GNU compilers > that use th

Re: Feature request - a macro defined for GCC

2008-07-01 Thread Robert Dewar
Andrew Haley wrote: x z wrote: I would like to see that GCC define a macro in the case it is being used to compile a program. Currently there is a __GNUC__ macro defined by the GNU C preprocessor CPP. That does not suit the need. As the CPP Manual says: __GNUC__ is "defined by all GNU compiler

Re: free (static_array)

2008-07-01 Thread Michael Meissner
On Tue, Jul 01, 2008 at 11:50:58AM +0200, Denys Vlasenko wrote: > On Tuesday 01 July 2008 09:24, Sajish V wrote: > > Thanks for the reply, Denys. > > My question was, why doesn't gcc catch it during compilation? It is clear > > that we are trying to free a variable from stack. Shouldn't gcc flag an

Re: free (static_array)

2008-07-01 Thread Joseph S. Myers
On Tue, 1 Jul 2008, Michael Meissner wrote: > On Tue, Jul 01, 2008 at 11:50:58AM +0200, Denys Vlasenko wrote: > > On Tuesday 01 July 2008 09:24, Sajish V wrote: > > > Thanks for the reply, Denys. > > > My question was, why doesn't gcc catch it during compilation? It is clear > > > that we are tryi

Re: Feature request - a macro defined for GCC

2008-07-01 Thread rkiesling
Robert Dewar: [ Charset ISO-8859-1 converted... ] > Andrew Haley wrote: > > x z wrote: > > > >> I would like to see that GCC define a macro in the case it is being > >> used to compile a program. Currently there is a __GNUC__ macro > >> defined by the GNU C preprocessor CPP. That does not suit t

Re: Feature request - a macro defined for GCC

2008-07-01 Thread Robert Dewar
rkiesling wrote: I didn't know that anyone had a special claim to GNU and/or GCC. The free software foundation owns the copyright, or has assignments of the copyrights from authors, so it indeed has a "special claim". I thought the trademark thing was tried, but, with all of the instances of

Viel Moneten in winziger Zeit

2008-07-01 Thread Annabella tillmanns
Sie moechten Ihre Freizeit gegen Klunker waechseln?? Sie haben eine Maenge Freizeit? Bitte bei uns an [EMAIL PROTECTED] kurz melden, die Details kommen bald

Re: free (static_array)

2008-07-01 Thread Michael Meissner
On Tue, Jul 01, 2008 at 11:37:05AM +, Joseph S. Myers wrote: > On Tue, 1 Jul 2008, Michael Meissner wrote: > > > On Tue, Jul 01, 2008 at 11:50:58AM +0200, Denys Vlasenko wrote: > > > On Tuesday 01 July 2008 09:24, Sajish V wrote: > > > > Thanks for the reply, Denys. > > > > My question was, wh

Re: Feature request - a macro defined for GCC

2008-07-01 Thread x z
I think an important point was missed in the discussion. Some seem to focus on the dishonest definition of __GNUC__ by non-GNU C compilers. That was not my point. My point is that if __GNUC__ is defined by CPP, not the GNU C compiler proper, (and this seems to be supported by the CPP Manual,

Re: Feature request - a macro defined for GCC

2008-07-01 Thread Andrew Haley
x z wrote: > I think an important point was missed in the discussion. Some seem > to focus on the dishonest definition of __GNUC__ by non-GNU C > compilers. That was not my point. My point is that if __GNUC__ is > defined by CPP, not the GNU C compiler proper, (and this seems to be > supported

Re: Feature request - a macro defined for GCC

2008-07-01 Thread Peter Barada
> I think an important point was missed in the discussion. Some seem to > focus on the dishonest definition of __GNUC__ by non-GNU C compilers. > That was not my point. My point is that if __GNUC__ is defined by > CPP, not the GNU C compiler proper, (and this seems to be supported by > the CPP M

Re: Feature request - a macro defined for GCC

2008-07-01 Thread Ian Lance Taylor
x z <[EMAIL PROTECTED]> writes: > I think an important point was missed in the discussion. Some seem > to focus on the dishonest definition of __GNUC__ by non-GNU C > compilers. That was not my point. My point is that if __GNUC__ is > defined by CPP, not the GNU C compiler proper, (and this see

Re: Feature request - a macro defined for GCC

2008-07-01 Thread Jack Lloyd
On Tue, Jul 01, 2008 at 05:34:17PM +, x z wrote: > > I think an important point was missed in the discussion. Some seem to focus > on the dishonest definition of __GNUC__ by non-GNU C compilers. That was not > my point. My point is that if __GNUC__ is defined by CPP, not the GNU C > comp

Re: RFC: Adding non-PIC executable support to MIPS

2008-07-01 Thread Richard Sandiford
Daniel Jacobowitz <[EMAIL PROTECTED]> writes: > We've shipped our version. Richard's version has presumably also > shipped. Right. > We did negotiate the ABI changes with MTI; this is not quite > as good as doing it in full view, but it was the best we could manage > and MTI is as close to a cen

RE: Feature request - a macro defined for GCC

2008-07-01 Thread x z
> I very much doubt that any compiler other than gcc uses the gcc > preprocessor. > > In any case, the documentation has in some sense misled you. __GNUC__ > is indeed defined by the compiler proper, not by the preprocessor. > But that in turn does not matter, as if any non-gcc compiler *did* use

Re: RFC: Adding non-PIC executable support to MIPS

2008-07-01 Thread Richard Sandiford
Richard Sandiford <[EMAIL PROTECTED]> writes: > I've been thinking about that a lot recently, since I heard about > your implementation. I kind-of guessed it had been agreed with MTI > beforehand (although I hadn't realised MTI themselves had written > the specification). Having thought it over,

RE: Feature request - a macro defined for GCC

2008-07-01 Thread x z
> In any case, the documentation has in some sense misled you. __GNUC__ > is indeed defined by the compiler proper, not by the preprocessor. > But that in turn does not matter, as if any non-gcc compiler *did* use > the gcc preprocessor, it would do so via gcc -E. > Googling "Intel C++ __GNUC__"

Re: Feature request - a macro defined for GCC

2008-07-01 Thread Jim Wilson
x z wrote: I would like to see that GCC define a macro in the case it is being used to compile a program. Currently there is a __GNUC__ macro defined by the GNU C preprocessor CPP. This is our mistake. Originally __GNUC__ meant that this was the GNU C compiler (aka GNU Compiler Collection).

RE: Feature request - a macro defined for GCC

2008-07-01 Thread Joseph S. Myers
On Tue, 1 Jul 2008, x z wrote: > On the other hand, the 1997 sentence "if you invoke the preprocessor > directly, `__GNUC__' is undefined" is now replaced by "These macros are > also defined if you invoke the preprocessor directly." I have not had > the time to find out what "invoke the prepro

questions on using gcov of GCC

2008-07-01 Thread haod
Hi, I am using the GCOV command of GCC and have some puzzles on the branch information it provides. For example, void main() { 2 int i,j; 2 j=0; 2 if(j<3) branch 0 taken = 0% 2 j++; 6 for(i=1;i<3;i++) branch 0 taken =67% branch 1

RE: Feature request - a macro defined for GCC

2008-07-01 Thread x z
This is somewhat off-topic. Perhaps the GCC development team should consider making this __GNUC__ stuff more clarified in the GCC Manual. Now, this __GNUC__ stuff appears to appear only in the CPP Manual (section 3.7.2). And the definition of similar macros such as __GFORTRAN__ and __GNUG__ may

Re: Feature request - a macro defined for GCC

2008-07-01 Thread Jim Wilson
x z wrote: This is somewhat off-topic. Perhaps the GCC development team should consider making this __GNUC__ stuff more clarified in the GCC Manual. I don't think this is off-topic. We need to get people to understand that __GNUC__ is ambiguous before we can solve the problem. It means two

RE: Feature request - a macro defined for GCC

2008-07-01 Thread x z
> If we want to fix this, gcc must change. And this may > also require GNU libc changes and linux kernel changes, etc. Maybe you can enlighten us a bit on why GNU libc and linux kernel need changes so that we can realize better how complicated the issue is. > The talk about whether __GNUC__ is d

Re: [10 PATCHES] inline functions to avoid stack overflow

2008-07-01 Thread Mikulas Patocka
On Wed, 25 Jun 2008, David Miller wrote: From: Mikulas Patocka <[EMAIL PROTECTED]> Date: Wed, 25 Jun 2008 08:53:10 -0400 (EDT) Even worse, gcc doesn't use these additional bytes. If you try this: extern void f(int *i); void g() { int a; f(&a); } , it allocates additional

Re: [10 PATCHES] inline functions to avoid stack overflow

2008-07-01 Thread David Miller
From: Mikulas Patocka <[EMAIL PROTECTED]> Date: Wed, 2 Jul 2008 00:39:35 -0400 (EDT) > The ABI is very vague about it. The V9 ABI just displays that 6-word space > in a figure bug doesn't say anything about it's usage. The V8 ABI just > says that "the function may write incoming arguments there"