use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Olivier Hainque
Hello, genmodes.c uses the %n capabilities of printf to compute the width of pieces it outputs. This causes troubles on Windows Vista, because ... << Because of security reasons, support for the %n format specifier is disabled by default in printf and all its variants. ... the default

Creating a patch ready for gcc-patches list

2007-06-06 Thread Brian Sidebotham
Hi, I am building a cross-compiler for arm, which builds "okay", but the output is very noisy whilst compiling gcc. I'd like to sort some of it out and submit some patches, but I've not done any patches for gcc before so I don't want to create a lot of noise on the gcc-patches list by posting

Re: Creating a patch ready for gcc-patches list

2007-06-06 Thread Manuel López-Ibáñez
On 06/06/07, Brian Sidebotham <[EMAIL PROTECTED]> wrote: Hi, I am building a cross-compiler for arm, which builds "okay", but the output is very noisy whilst compiling gcc. I'd like to sort some of it out and submit some patches, but I've not done any patches for gcc before so I don't want to cr

Re: Creating a patch ready for gcc-patches list

2007-06-06 Thread Jan-Benedict Glaw
On Wed, 2007-06-06 10:15:41 -0700, Brian Sidebotham <[EMAIL PROTECTED]> wrote: > --- ./gcc/value-prof.cMon Jun 4 17:27:14 2007 > +++ ./gcc/value-prof.cWed Jun 6 10:13:20 2007 > > @@ -883,15 +883,19 @@ tree_mod_subtract (tree stmt, tree opera >e12 = split_block (bb, bb1end); >

Re: Creating a patch ready for gcc-patches list

2007-06-06 Thread Brian Sidebotham
Hi, Sorry, wasted your time already!! Thanks to Manuel for the information too. I will re-patch, compile and run the testsuite. Sorry to waste your time with my first mail! Best Regards, Brian Sidebotham. Jan-Benedict Glaw wrote: On Wed, 2007-06-06 10:15:41 -0700, Brian Sidebotham <[EMAIL

RE: testsuite trigraphs.c failure due to cygwin

2007-06-06 Thread Dave Korn
On 04 June 2007 23:43, Ian Lance Taylor wrote: > "Timothy C Prince" writes: [ quoting an earlier post of mine ] >> So, am I correct to believe that we need to use plain 'inline' for c99 >> after gcc 4.4, and 'extern inline' before that? That is, I think I need >> to write a test that looks

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Simon Brenner
In this case, you don't have to look far to see that you can't use the return value of printf. According to my manpage, printf returns 0 on success, 1 on failure. No mention of the number of characters written. This is different with sprintf/snprintf (see e.g http://www.opengroup.org/onlinepubs/0

RE: current gcc trunk testsuite failure on cygwin: Assembler messages: Warning: end of file in string; '"' inserted: Warning: .stabs: missing comma

2007-06-06 Thread Dave Korn
On 04 June 2007 17:02, Christian Joensson wrote: > configured by ../gcc/configure, generated by GNU Autoconf 2.59, > with options \" '--disable-nls' '--without-included-gettext' > '--enable-version-specific-runtime-libs' '--without-x' > '--disable-libgcj' '--with-system-zlib' '--enable-threads=

RE: current gcc trunk testsuite failure on cygwin: Assembler messages: Warning: end of file in string; '"' inserted: Warning: .stabs: missing comma

2007-06-06 Thread Dave Korn
On 05 June 2007 01:57, Tim Prince wrote: > christian.joensson wrote: >> phew, a few of the cygwin failures show up like this: >> >> Executing on host: /usr/local/src/trunk/objdir/gcc/xgcc >> -B/usr/local/src/trunk/objdir/gcc/ -O3 -g -w -fno-show-column -c >> -o 20001226-1.o >> /usr/local/src/t

RE: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Dave Korn
On 06 June 2007 12:04, Simon Brenner wrote: > According to my manpage, printf returns 0 on success, 1 on failure. No > mention of the number of characters written. Well, maybe you should ... > use a Real Operating System ! What man page exactly are you referring to? cheers,

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Simon Brenner
In this case, it's the Mac OS X man page. Which I now see doesn't say the same thing as POSIX. Which was just the point I was trying to make - you can't rely on the return value for determining the number of characters written. Oh, and I am sure the reality of my Operating System is very close to

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Andrew Haley
Please don't top-post. Simon Brenner writes: > On 6/6/07, Dave Korn <[EMAIL PROTECTED]> wrote: > > On 06 June 2007 12:04, Simon Brenner wrote: > > > > > According to my manpage, printf returns 0 on success, 1 on failure. No > > > mention of the number of characters written. > > > > Well,

RE: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Rupert Wood
Andrew Haley wrote: > > In this case, it's the Mac OS X man page. Which I now see doesn't > > say the same thing as POSIX. Which was just the point I was > > trying to make you can't rely on the return value for determining > > the number of characters written. > Yes we can. gcc is written in ISO

gcj java help

2007-06-06 Thread sharads
Hello all, How I can import security in gcj java as we used keytool in jdk. Plz give me appropriate guidence. -- Thanks and Regards Sharad Singh Sr. Project Associate EE, IIT Kanpur Mob:+91- 9450 328 117 Accessing Brihaspati: http://202.141.40.217:8080/brihaspati/servlet/brihaspati Login:

RE: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Rupert Wood
> Documentation error? They've got the same man page for printf(1) > and printf(3): Oh, except trying it on a real Mac they don't - that website's broken. Simon, you need to type: man 3 printf to read about printf() the C function. Rup. __

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Richard Kenner
> According to my manpage, printf returns 0 on success, 1 on failure. No > mention of the number of characters written. This is different with > sprintf/snprintf (see e.g > http://www.opengroup.org/onlinepubs/95399/functions/snprintf.html), > but IIRC a number of platforms don't implement those

Re: testsuite trigraphs.c failure due to cygwin

2007-06-06 Thread Tim Prince
[EMAIL PROTECTED] wrote: On 04 June 2007 23:43, Ian Lance Taylor wrote: "Timothy C Prince" writes: [ quoting an earlier post of mine ] So, am I correct to believe that we need to use plain 'inline' for c99 after gcc 4.4, and 'extern inline' before that? That is, I think I need to writ

Re: libjava is a train wreck.

2007-06-06 Thread Diego Novillo
On 6/5/07 12:28 AM, Steve Kargl wrote: > Can someone explain why libjava *must* commit binary files to the > repository? A merge of trunk to the fortran-experiments branch > generated 70 conflicts that I need to resolve. You should not have conflicts in libjava. You may have botched a merger ear

RE: testsuite trigraphs.c failure due to cygwin

2007-06-06 Thread Dave Korn
On 06 June 2007 14:35, Tim Prince wrote: [ artimi dot org removed from Cc: line as it does not exist. ] >> Tim, are you sure you have the patched version of stdio.h in your >> /usr/include, or are you trying a combined build? >> > > I have patched stdio.h, but it may not be your latest reco

RE: segmentation fault

2007-06-06 Thread Dave Korn
On 05 June 2007 16:49, [EMAIL PROTECTED] wrote: > With apologies for being new: > In porting a hardware configuration from gcc-3.4.1 to gcc-4.2.0, I'm > getting the following error message: > > In file included from /cygdrive/c/gcc-4.2.0/gcc/crtstuff.c:68: > /cygdrive/c/gcc-4.2.0/gcc/tsystem.h:53

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Ian Lance Taylor
Olivier Hainque <[EMAIL PROTECTED]> writes: > genmodes.c uses the %n capabilities of printf to compute the width of > pieces it outputs. This causes troubles on Windows Vista, because ... > ><< Because of security reasons, support for the %n format specifier is > disabled by default in

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Simon Brenner
Simon, you need to type: man 3 printf to read about printf() the C function. Argh! Indeed I was reading the wrong manpage. That probably means almost everything I've concluded and said was wrong :/ Apparently, throwing your two cents in can reduce the total value of a discussion. According to

Re: When was decimal floating point added to gcc?

2007-06-06 Thread Gerald Pfeifer
On Mon, 4 Jun 2007, H. J. Lu wrote: >> Support for the decimal floating point C extension could be mentioned >> in the release notes for GCC 4.2, but there it's only supported for >> powerpc*-linux and x86*-linux and only if requested at configure time. >> The ABI for powerpc*-linux has changed sin

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Jack Lloyd
On Wed, Jun 06, 2007 at 07:29:26AM -0700, Ian Lance Taylor wrote: > Olivier Hainque <[EMAIL PROTECTED]> writes: > > > genmodes.c uses the %n capabilities of printf to compute the width of > > pieces it outputs. This causes troubles on Windows Vista, because ... > > > ><< Because of security r

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Paolo Bonzini
Or, if we think that other systems are likely to also start disabling %n by default, then it would make sense for us to change the code. It would be easy to replace it with strlen calls, or, as you suggest, by checking the return value of printf. The return value of printf is portable (unlike

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Olivier Hainque
Ian Lance Taylor wrote: > What is the security issue here? I'm not seeing it. Are they > concerned that attackers will modify the print control string somehow? I don't know. We simply have observed bootstrap problems during preliminary experiments on Vista, found them to be caused by uninitia

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Olivier Hainque
Paolo Bonzini wrote: > * genmodes.c (tagged_printf, emit_insn_modes_h): Don't > use %n on printf. Almost identical to what we have been doing internally to circumvent the issue, Thanks. Olivier

how to build executable instructions blocks dynamically

2007-06-06 Thread Gorgonite
Hello, I'm sorry if the answer has already been given, but I haven't found :'( I want to build executable instructions blocks dynamically, in order to use the "preparations sequences" in a virtual machine. I want to create a buffer and to put some code into it. Until now, I've thought (with

RE: current gcc trunk testsuite failure on cygwin: Assembler messages: Warning: end of file in string; '"' inserted: Warning: .stabs: missing comma

2007-06-06 Thread Dave Korn
On 04 June 2007 17:02, Christian Joensson wrote: > phew, a few of the cygwin failures show up like this: > /usr/local/src/trunk/gcc/gcc/testsuite/gcc.c-torture/compile/20001226-1.c > /cygdrive/c/DOCUME~1/chj/LOCALS~1/Temp/cc2eakcj.s: Assembler messages: > /cygdrive/c/DOCUME~1/chj/LOCALS~1/Temp/cc

RE: current gcc trunk testsuite failure on cygwin: Assembler messages: Warning: end of file in string; '"' inserted: Warning: .stabs: missing comma

2007-06-06 Thread Dave Korn
On 06 June 2007 17:49, Dave Korn wrote: > So, what's happening is that dbxout.c is recursing massively (perhaps to > be expected from a testcase involving pointer-to-pointer-to-pointer-to > pointer-to-int.) Confirmed by relinking cc1.exe with "-Wl,--stack,10240" and seeing that it

[bug] undefined symbols with -Woverloaded-virtual and -fprofile-arcs -ftest-coverage

2007-06-06 Thread Lothar Werzinger
Hi, when I build a coverage build of my software I get some undefined symbols like global constructors keyed to src_utility_Tree.cpp_90B986A5_564B8955 I did some investigation and as you can see in the below test it only occurs if I specify -Woverloaded-virtual. What is strange, too is that if I

Re: how to build executable instructions blocks dynamically

2007-06-06 Thread Mike Stump
On Jun 6, 2007, at 9:43 AM, Gorgonite wrote: I'm sorry if the answer has already been given, but I haven't found :'( Yes, it has, google will find it too... :-) I want to build executable instructions blocks dynamically Wrong list... You want a list that has something to do with the OS

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Andrew Haley
Robert Dewar writes: > Andrew Haley wrote: > > > Yes we can. gcc is written in ISO C, and ISO C says that the printf > > function returns the number of characters transmitted, or a negative > > value if an error occurred. We don't support bootstrapping gcc on > > non-ISO systems. > > We

dataflow branch merge plans.

2007-06-06 Thread Kenneth Zadeck
At this point the entire branch has been reviewed by Ian Taylor. It is expected that all of the changes that he has asked for will be committed either tonight or tomorrow. Danny Berlin will do another merge with the trunk tonight and we will test that. As of last week, the dataflow branch was c

RE: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Danny Smith
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Simon Brenner > Sent: Thursday, 7 June 2007 2:40 a.m. > > > Or just add a call to _set_printf_count_output in the relevant > > > place, since AFAIK %n is still a standard-mandated printf format > > >

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Robert Dewar
Andrew Haley wrote: Mmm, but I don't believe that the printf function returning the number of characters transmitted is problematic. As far as we know, that works everywhere. The only thing to say otherwise is a man page. My guess is the man page is wrong. OK, I misunderstood the situation,

Re: When was decimal floating point added to gcc?

2007-06-06 Thread Ben Elliston
On Wed, 2007-06-06 at 16:46 +0200, Gerald Pfeifer wrote: > In that case it's probably not that good of a idea to promote it (unless > the maintainers are in favor, of course ;-). I'm happy to leave things as they are for now. Cheers, Ben -- Ben Elliston <[EMAIL PROTECTED]> Australia Developmen

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Robert Dewar
Danny Smith wrote: Unless I'missing soemthing, this is 'just' a build issue in genmode.c. GCC builds fine for Vista target on WindowsXP. So the fix needs to be build dependent, not host dependent. Well if a clean fix can be found that simply avoids the use of %n, then that's target independ

gcc-4.2-20070606 is now available

2007-06-06 Thread gccadmin
Snapshot gcc-4.2-20070606 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.2-20070606/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.2 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches

Re: libjava is a train wreck.

2007-06-06 Thread Ben Elliston
On Wed, 2007-06-06 at 08:29 -0400, Diego Novillo wrote: > You should not have conflicts in libjava. You may have botched a merger > earlier. I never ran into this with the branches I've maintained. Try > copying libjava out of trunk again. Out of interest, what happens if you have svn file pro

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Aaron Gray
Danny Smith wrote: Unless I'missing soemthing, this is 'just' a build issue in genmode.c. GCC builds fine for Vista target on WindowsXP. So the fix needs to be build dependent, not host dependent. Well if a clean fix can be found that simply avoids the use of %n, then that's target independen

Re: [bug] undefined symbols with -Woverloaded-virtual and -fprofile-arcs -ftest-coverage

2007-06-06 Thread Joe Buck
On Wed, Jun 06, 2007 at 11:13:16AM -0700, Lothar Werzinger wrote: > when I build a coverage build of my software I get some undefined symbols > like global constructors keyed to src_utility_Tree.cpp_90B986A5_564B8955 > > I did some investigation and as you can see in the below test it only occurs

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Richard Kenner
> I think a sprintf followed by a strlen and printf is _guarenteed_ to be much > more portable than printf's return value. The overhead of the strlen is > minimal. Maybe portable, but how do you choose the length of the buffer to pass to sprintf! Ironic: we'd be trading a mostly-bogus security

Re: use of %n in genmodes.c causes trouble on Vista

2007-06-06 Thread Aaron Gray
I think a sprintf followed by a strlen and printf is _guarenteed_ to be much more portable than printf's return value. The overhead of the strlen is minimal. Maybe portable, but how do you choose the length of the buffer to pass to sprintf! Ironic: we'd be trading a mostly-bogus security issue