void* vs void *

2016-01-29 Thread Magnus Fromreide
I just noticed that the C and C++ compiler output pointer types differently: Consider int i; printf("%p", ); When compiled as C that gives the warning format '%p' expects argument of type 'void *', but argument 2 has type 'int *' but when compiled as C++ it gives the warning format '%p'

Typo: gcc-5/changes.html

2015-03-27 Thread Magnus Fromreide
In gcc-5/changes.html the section about __has_include and __has_include_next says: The header search paths for __has_include_next and __has_include_next are equivalent to those of the standard directive #include and the extension #include_next respectively. I think the first __has_include_next

Re: Remove unused debugging arg from last change

2012-10-23 Thread Magnus Fromreide
On Tue, Oct 23, 2012 at 03:28:37PM -0600, Jeff Law wrote: Committed as obvious. * tree-ssa-threadedge.c (cond_arg_set_in_bb): Remove unused debugging argument. Could you please remove the third argument in the calls to cond_arg_set_in_bb as well? /MF Index:

Re: add typedef printers to libstdc++

2012-09-22 Thread Magnus Fromreide
On Fri, 2012-09-21 at 14:59 -0600, Tom Tromey wrote: This patch adds some typedef printers to libstdc++. This relies on a gdb patch that hasn't yet gone in (pending on the list). If the gdb patch changes, I'll change these printers as well. The basic idea is that you can now have gdb

Re: [bootstrap] Tentative fix for PR 54281

2012-08-16 Thread Magnus Fromreide
On Thu, Aug 16, 2012 at 07:55:51AM -0400, Diego Novillo wrote: Richi, this implements your idea for fixing PR 54281. I don't have an old enough compiler. Could you please test it in your system? I debated whether to remove the GENERATOR_FILE predicate from the inclusion (some files

Re: [PATCH] Move Graphite from using PPL over to ISL

2012-07-04 Thread Magnus Fromreide
Hello. Ever since the ISL patch went in my builds have failed. I am building with local copies of all the libraries, so I have added gmp, mpfr, mpc, isl and cloog from ftp://gcc.gnu.org/pub/gcc/infrastructure to my source directory. The command sequence I use is svn co

Re: [x86-64 psABI] RFC: Extend x86-64 psABI to support x32

2012-06-27 Thread Magnus Fromreide
On Wed, 2012-06-27 at 05:01 -0700, H.J. Lu wrote: On Tue, Jun 26, 2012 at 10:56 PM, Mark Butler butl...@middle.net wrote: On Tuesday, June 26, 2012 3:22:45 PM UTC-6, H.J. wrote: On Tue, Jun 26, 2012 at 2:11 PM, Mark Butler wrote: x32 is designed to replace ia32 where long is

Re: [wwwdocs] Update coding conventions for C++

2012-06-26 Thread Magnus Fromreide
On Mon, 2012-06-25 at 15:17 -0700, Lawrence Crowl wrote: On 6/25/12, Joseph S. Myers jos...@codesourcery.com wrote: On Mon, 25 Jun 2012, Diego Novillo wrote: [ Added doc maintainers in CC ] I have added a bit more in the rationale, reached through the link at the end of that section.

Re: PING: [C++-11 PATCH] Trailing comma in enum

2011-10-30 Thread Magnus Fromreide
On Sat, 2011-10-29 at 20:48 +0300, Ville Voutilainen wrote: Could someone please review this? + if (cxx_dialect cxx0x !in_system_header) + pedwarn (input_location, OPT_pedantic, + comma at end of enumerator list); Why not use maybe_warn_cpp0x there?

PING: [C++-11 PATCH] Trailing comma in enum

2011-10-28 Thread Magnus Fromreide
Could someone please review this? On Sun, 2011-10-09 at 16:27 +0200, Magnus Fromreide wrote: Hi. As I understand it C++-11 allows trailing commas in enum definitions. Thus I think the following little patch should be included. /MF 2011-10-09 Magnus Fromreide ma...@lysator.liu.se

[C++ Patch] Trailing comma in enum

2011-10-09 Thread Magnus Fromreide
Hi. As I understand it C++11 allows trailing commas in enum definitions. Thus I think the following little patch should be included. On a side note I have to say that the effects of pedwarn_cxx98 are unexpected, especially in light of the comment above the function body. /MF 2011-10-09 Magnus

pedwarn_cxx98 and enum { foo, }

2011-04-28 Thread Magnus Fromreide
Hello. I noticed that (foo.cpp): enum gaz { foo, }; generated a warning foo.cpp:1:15: warning: comma at end of enumerator list [-pedantic] when compiled with g++ -std=gnu++0x -pedantic -fsyntax-only foo.cpp According to n3290 this is acceptable so I tried to make this warning go away. This

Re: [v3] Re-implement is_constructible, add is_default_constructible, is_destructible, fix PR 48526

2011-04-14 Thread Magnus Fromreide
On Thu, 2011-04-14 at 00:48 +0200, Paolo Carlini wrote: Hi! over the last 2 days or so, Daniel Krugler - having filed in due course his Copyright Assignment - finally kindly contributed to the project shiny new std::is_constructible, std::is_default_constructible and

Re: Implement stack arrays even for unknown sizes

2011-04-09 Thread Magnus Fromreide
On Sat, 2011-04-09 at 09:21 +0100, N.M. Maclaren wrote: On Apr 8 2011, Michael Matz wrote: It adds a new option -fstack-arrays which makes the frontend put all local arrays on stack memory. ... Excellent! I haven't rechecked performance now, but four months ago this was the result

RE: Range-based for in c++98

2010-09-20 Thread Magnus Fromreide
On Mon, 2010-09-20 at 10:39 +0200, Rodrigo Rivas wrote: This is quite unreadable and not very informative. Totally agree. Here there are two problems... snipped I think that you are taking the wrong approach: you call cp_parser_range_for with C++98 and then if such a loop is parsed

Range-based for in c++98

2010-09-17 Thread Magnus Fromreide
Hello. At the moment compilation of a range-based for in c++98 fails with the error message: foo.cpp: In function 'int foo()': foo.cpp:4:13: error: expected initializer before ':' token foo.cpp:6:1: error: expected primary-expression before '}' token foo.cpp:6:1: error: expected ';' before '}'

Re: Please support coo.h

2010-06-10 Thread Magnus Fromreide
On Fri, 2010-06-11 at 08:44 +0800, yuanbin wrote: typedef struct CBase { int i; } CBase; typedef struct CT1 { EXTENDS(CBase) ... } CT1; typedef struct CT2 { EXTENDS(CT1) ... } CT2; ... typedef struct CTN { EXTENDS(CTN_1) ... } CTN; CTN t; t.i=1; //need not t.CTN_1CT2.CT1.CBase.i

-pthread

2010-05-04 Thread Magnus Fromreide
I recently ended up in a discussion about the -pthread flag at work and when looking at the documentation I noticed that it is defined onlt for SPARC and RS/6000/PowerPC. Additionally -fopenmp and -ftree-parallelize-loops say they are only supported on targets where -pthread are available. Now,

Re: The scope of a for statement

2010-03-13 Thread Magnus Fromreide
On Fri, 2010-03-05 at 15:07 -0800, Joe Buck wrote: On Fri, Mar 05, 2010 at 02:40:44PM -0800, Magnus Fromreide wrote: On Fri, Mar 05, 2010 at 12:06:01PM -0800, Joe Buck wrote: On Fri, Mar 05, 2010 at 11:38:23AM -0800, Magnus Fromreide wrote: Hello. I tried to do

The scope of a for statement

2010-03-05 Thread Magnus Fromreide
Hello. I tried to do for (;; ({ break; })) printf(Hello\n); and got an error message: error: break statement not within loop or switch when compiling it as C. Given that 9899:1999 §6.8.6.3 says that a break statement only shall appear in or as a switch or loop body that is expected.

Re: The scope of a for statement

2010-03-05 Thread Magnus Fromreide
On Fri, Mar 05, 2010 at 12:06:01PM -0800, Joe Buck wrote: On Fri, Mar 05, 2010 at 11:38:23AM -0800, Magnus Fromreide wrote: Hello. I tried to do for (;; ({ break; })) printf(Hello\n); and got an error message: error: break statement not within loop or switch

C++ DR/354

2010-02-14 Thread Magnus Fromreide
Hello. I tried to look at fixing DR/354 but ended up lost in cp/parser.c I have the following test case: template int* struct S { }; S(int*)0 s; and end up with the following errors :2:9: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression

Re: [gcc-in-cxx] replacing qsort with std::sort

2009-08-29 Thread Magnus Fromreide
On Fri, 2009-08-28 at 18:12 -0300, Pedro Lamarão wrote: 2009/8/11 Pedro Lamarão pedro.lama...@ccppbrasil.org: I've recently started my contributions to the gcc-in-cxx project, and eventually decided on the qsort suggestion because it seems the easiest one. Attached is a much more

Re: Bug or feature? C++ code that no longer compiles under GCC 4.2

2007-08-30 Thread Magnus Fromreide
On ons, 2007-08-29 at 16:42 -0400, Daniel Drake wrote: Hi, Take the following code sample: #define BREAK_GCC4_2 templatetypename Op void foo(Op op) { op(); } class My { public: static void myOp() { } void test() { #ifdef

__sync_bool_compare_and_swap

2007-01-05 Thread Magnus Fromreide
I got so happy when __sync_bool_compare_and_swap showed up in 4.1 but now HEAD have changed the behaviour for me. Earlier I got (gcc version 4.1.2 20061028 (prerelease) (Debian 4.1.1-19)) (Yes, vendor version, but gcc.gnu.org versions did the same) lock cmpxchgl%edx,

Re: __sync_bool_compare_and_swap

2007-01-05 Thread Magnus Fromreide
On fre, 2007-01-05 at 17:05 +, Andrew Haley wrote: Magnus Fromreide writes: But it can't unless you use an architecture that has cmpxchgl. cmpxchgl is a 486 instruction; if you compile for 386, we have to generate the call because there is no such instruction. Sigh - I failed to tell

Re: __sync_bool_compare_and_swap

2007-01-05 Thread Magnus Fromreide
On fre, 2007-01-05 at 12:53 -0800, H. J. Lu wrote: On Fri, Jan 05, 2007 at 09:27:35PM +0100, Magnus Fromreide wrote: On fre, 2007-01-05 at 17:05 +, Andrew Haley wrote: Magnus Fromreide writes: But it can't unless you use an architecture that has cmpxchgl. cmpxchgl is a 486

Re: cast to pointer from integer of different size

2006-09-21 Thread Magnus Fromreide
On tor, 2006-09-21 at 23:10 -0500, Peter Bergner wrote: On Thu, 2006-09-21 at 23:54 -0400, Jack Howarth wrote: Peter, Wouldn't we want something like... +#ifdef __powerpc64__ +unsigned long FindTopOfStack(unsigned long stack_start) { +#else unsigned long