[Bug c++/99154] New: cout << and triadic issue

2021-02-18 Thread daffra.claudio at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99154

Bug ID: 99154
   Summary: cout << and triadic issue
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daffra.claudio at gmail dot com
  Target Milestone: ---

file example :

#include 

using namespace std;

int main()
{
cout<<"Hello World : "<< 1?2:3;

return 0;
}

output :

Hello World : 1  

expected :

error message for ?2:3 

[Bug c/96093] __MATHCALLX Error with ';' missing in header file

2020-07-10 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96093

--- Comment #2 from claudio daffra  ---
error disappear when i put   at top of include file , probably ...
FLAGS=-std=c11 -Wall  -Wextra -pedantic
LIBRARYS=-lm ...  link without header
boh .. can you close.


Il giorno mer 8 lug 2020 alle ore 23:44 pinskia at gcc dot gnu.org <
gcc-bugzi...@gcc.gnu.org> ha scritto:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96093
>
> Andrew Pinski  changed:
>
>What|Removed |Added
>
> 
>  Status|UNCONFIRMED |WAITING
>Keywords||diagnostic
>Last reconfirmed||2020-07-09
>  Ever confirmed|0   |1
>
> --- Comment #1 from Andrew Pinski  ---
> Can you attach the preprocessed source as requested by
> https://gcc.gnu.org/bugs.html ?
>
> --
> You are receiving this mail because:
> You reported the bug.

[Bug c/96093] New: __MATHCALLX Error with ';' missing in header file

2020-07-07 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96093

Bug ID: 96093
   Summary: __MATHCALLX Error with ';' missing in header file
   Product: gcc
   Version: 9.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daffra.claudio at gmail dot com
  Target Milestone: ---

TITLE

__MATHCALLX Error with ; missing

SOURCE CODE

#ifndef cdParser
#define cdParser

#include 
#include 

#include "error.h"
#include "lexer.h"
#include "../lib/mstack.h"
#include "ast.h"

// PROTOTYPE

sym_t   cdParserGetToken(void) ;   
// parser.c

node_t* cdParserTerm(void) ;   
// expr.c
node_t* cdParserMulDivMod   (void) ;   
// expr.c
node_t* cdParserAddSub  (void) ;   
// expr.c
node_t* cdParserExpr(void) ;   
// expr.c
node_t* cdParserScan(char* fileSourceName
);// parser.c

node_t* cdParserDeclGlobalConst (void) ;   
// decl.c

// OBJECT PARSER

typedef struct parser_s
{
sym_t   (*getToken) (void) ;
node_t* (*term) (void) ;
node_t* (*mulDivMod)(void) ;
node_t* (*addSub)   (void) ;
node_t* (*expr) (void) ;
node_t* (*scan) (char* fileSourceName )
;
node_t* (*declGlobalConst)  (void);
} parser_t;

...

ERROR

if i omit ';' in parser.h

[ok]node_t* cdParserDeclGlobalConst (void) ;   
// decl.c
[ko]node_t* cdParserDeclGlobalConst (void) 
// decl.c

compiler emit me  a long error message about MATHCALLX ...

EXPECT

I expetcted a simple syntax error indeed

gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.

FLAGS=-std=c11 -Wall  -Wextra -pedantic

ERROR MESSAGE 

/usr/include/x86_64-linux-gnu/bits/mathcalls.h:332:1: error: storage
class specified for parameter ‘__fminf32x’
  332 | __MATHCALLX (fmin,, (_Mdouble_ __x, _Mdouble_ __y),
(__const__));
  | ^~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:335:1: error: storage
class specified for parameter ‘fmaf32x’
  335 | __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_
__z));
  | ^~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:335:1: error: storage
class specified for parameter ‘__fmaf32x’
  335 | __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_
__z));
  | ^~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:340:1: error: storage
class specified for parameter ‘roundevenf32x’
  340 | __MATHCALLX (roundeven,, (_Mdouble_ __x), (__const__));
  | ^~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:340:1: error: storage
class specified for parameter ‘__roundevenf32x’
  340 | __MATHCALLX (roundeven,, (_Mdouble_ __x), (__const__));
  | ^~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:344:1: error: storage
class specified for parameter ‘fromfpf32x’
  344 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
  | ^~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:344:1: error: storage
class specified for parameter ‘__fromfpf32x’
  344 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
  | ^~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:349:1: error: storage
class specified for parameter ‘ufromfpf32x’
  349 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
  | ^~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:349:1: error: storage
class specified for parameter ‘__ufromfpf32x’
  349 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
  | ^~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:355:1: error: storage
class specified for parameter ‘fromfpxf32x’
  355 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
  | ^~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:355:1: erro

[Bug c/95257] New: valgrind gives me error when wprintf in stderr

2020-05-21 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95257

Bug ID: 95257
   Summary: valgrind gives me error when wprintf in stderr
   Product: gcc
   Version: 7.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daffra.claudio at gmail dot com
  Target Milestone: ---

this simple program gives me error when i check with valgrind,
this happen in stderr only.

valgrind --leak-check=full --show-leak-kinds=all ./x


#include 
#include 

int main ( void )
{

fwprintf ( stderr , L"valgrind error\n" ) ;
return 0 ;
}

valgrind error :

==7438== Memcheck, a memory error detector
==7438== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==7438== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==7438== Command: ./x
==7438== 
valgrind error==7438== 
==7438== HEAP SUMMARY:
==7438== in use at exit: 5,120 bytes in 2 blocks
==7438==   total heap usage: 2 allocs, 0 frees, 5,120 bytes allocated
==7438== 
==7438== 1,024 bytes in 1 blocks are still reachable in loss record 1 of 2
==7438==at 0x4C2FB0F: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7438==by 0x4EBA18B: _IO_file_doallocate (filedoalloc.c:101)
==7438==by 0x4EBB88C: _IO_wfile_doallocate (wfiledoalloc.c:70)
==7438==by 0x4ECA378: _IO_doallocbuf (genops.c:365)
==7438==by 0x4EC26C7: _IO_wfile_overflow (wfileops.c:430)
==7438==by 0x4EBFD51: __woverflow (wgenops.c:217)
==7438==by 0x4EBFD51: _IO_wdefault_xsputn (wgenops.c:317)
==7438==by 0x4EC2AD0: _IO_wfile_xsputn (wfileops.c:1012)
==7438==by 0x4EA7089: buffered_vfprintf (vfprintf.c:2343)
==7438==by 0x4EA40FD: vfwprintf (vfprintf.c:1301)
==7438==by 0x4EBEA23: fwprintf (fwprintf.c:33)
==7438==by 0x1086A8: main (in /home/claudio/x)
==7438== 
==7438== 4,096 bytes in 1 blocks are still reachable in loss record 2 of 2
==7438==at 0x4C2FB0F: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7438==by 0x4EBB858: _IO_wfile_doallocate (wfiledoalloc.c:79)
==7438==by 0x4ECA378: _IO_doallocbuf (genops.c:365)
==7438==by 0x4EC26C7: _IO_wfile_overflow (wfileops.c:430)
==7438==by 0x4EBFD51: __woverflow (wgenops.c:217)
==7438==by 0x4EBFD51: _IO_wdefault_xsputn (wgenops.c:317)
==7438==by 0x4EC2AD0: _IO_wfile_xsputn (wfileops.c:1012)
==7438==by 0x4EA7089: buffered_vfprintf (vfprintf.c:2343)
==7438==by 0x4EA40FD: vfwprintf (vfprintf.c:1301)
==7438==by 0x4EBEA23: fwprintf (fwprintf.c:33)
==7438==by 0x1086A8: main (in /home/claudio/x)
==7438== 
==7438== LEAK SUMMARY:
==7438==definitely lost: 0 bytes in 0 blocks
==7438==indirectly lost: 0 bytes in 0 blocks
==7438==  possibly lost: 0 bytes in 0 blocks
==7438==still reachable: 5,120 bytes in 2 blocks
==7438== suppressed: 0 bytes in 0 blocks
==7438== 
==7438== For counts of detected and suppressed errors, rerun with: -v
==7438== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

compiler :

gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04).

[Bug target/91298] $ at the beginging causing Error: junk `(%rip)' after expression

2020-01-22 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91298

--- Comment #10 from claudio daffra  ---
Thanks, I'll check it out.

Il giorno mer 22 gen 2020 alle ore 11:47 jakub at gcc dot gnu.org <
gcc-bugzi...@gcc.gnu.org> ha scritto:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91298
>
> --- Comment #9 from Jakub Jelinek  ---
> (In reply to claudio daffra from comment #8)
> > it may not work with the double dollar ,
> > XSTR (x, 0) [0] == '$'
> > I can't verify '$$ id', "$$$ ... id" ad so on , at the moment
>
> ??? The only problem was with leading $, $ in other positions were ok in
> the
> past already. $$var should be treated like $var, in instructions wrapped in
> ()s, so ($$var) instead of $$var.
>
> --
> You are receiving this mail because:
> You reported the bug.

[Bug target/91298] $ at the beginging causing Error: junk `(%rip)' after expression

2020-01-22 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91298

--- Comment #8 from claudio daffra  ---
it may not work with the double dollar ,
XSTR (x, 0) [0] == '$'
I can't verify '$$ id', "$$$ ... id" ad so on , at the moment




Il giorno mer 22 gen 2020 alle ore 11:24 pskocik at gmail dot com <
gcc-bugzi...@gcc.gnu.org> ha scritto:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91298
>
> --- Comment #7 from pskocik at gmail dot com ---
> (In reply to CVS Commits from comment #6)
> > The master branch has been updated by Jakub Jelinek :
>
> Thank you for the fix!
>
> --
> You are receiving this mail because:
> You reported the bug.

[Bug c/91298] Error: junk `(%rip)' after expression

2019-07-30 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91298

--- Comment #2 from claudio daffra  ---
with -masm=intel, everything works without any other problem.

[Bug c/91298] New: Error: junk `(%rip)' after expression

2019-07-30 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91298

Bug ID: 91298
   Summary: Error: junk `(%rip)' after expression
   Product: gcc
   Version: 7.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daffra.claudio at gmail dot com
  Target Milestone: ---

Error: junk `(%rip)' after expression

complete error message

E:\provacx>   gcc lib\gc.c test\ex_vector_2.c -o   x.exe
C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s: Assembler messages:
C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:161: Error: junk `(%rip)'
after expression
C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:163: Error: junk `(%rip)'
after expression
C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:163: Error: unsupported
instruction `mov'
C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:173: Error: junk `(%rip)'
after expression
C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:179: Error: junk `(%rip)'
after expression
C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:179: Error: unsupported
instruction `mov'
C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:180: Error: junk `(%rip)'
after expression

#ifndef NORESULT
#define NORESULT
static int $result=0;
#endif

#define algorithm_AllOf(obj,id,from,to,lambda,flag) \
do {\
obj##DataType##id* it;  \
for ( it=from ; it!=to ; it++ ) \
{   \
if ( lambda )   \
{   \
++$result;  \
}   \
}   \
$result = ($result == obj##Size(v1)) ? 1 : 0 ;  \
} while(0);


int flag=0;

algorithm_AllOf(vector,v1,vectorBegin(v1),vectorEnd(v1), *it % 2 == 0 ,
);
printf("\n[%d]\n",$result);

this piece of code give me previos error in :

E:\provacx>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/Qt/Qt5.12.3/Tools/mingw730_64/bin/../libexec/gcc/x86_64-w64-mingw32/7.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-7.3.0/configure --host=x86_64-w64-mingw32
--build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64
--with-sysroot=/c/mingw730/x86_64-730-posix-seh-rt_v5-rev0/mingw64
--enable-shared --enable-static --disable-multilib
--enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes
--enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto
--enable-graphite --enable-checking=release --enable-fully-dynamic-string
--enable-version-specific-runtime-libs --enable-libstdcxx-filesystem-ts=yes
--disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap
--disable-rpath --disable-win32-registry --disable-nls --disable-werror
--disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona
--with-tune=core2 --with-libiconv --with-system-zlib
--with-gmp=/c/mingw730/prerequisites/x86_64-w64-mingw32-static
--with-mpfr=/c/mingw730/prerequisites/x86_64-w64-mingw32-static
--with-mpc=/c/mingw730/prerequisites/x86_64-w64-mingw32-static
--with-isl=/c/mingw730/prerequisites/x86_64-w64-mingw32-static
--with-pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 project'
--with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe
-fno-ident -I/c/mingw730/x86_64-730-posix-seh-rt_v5-rev0/mingw64/opt/include
-I/c/mingw730/prerequisites/x86_64-zlib-static/include
-I/c/mingw730/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2
-pipe -fno-ident
-I/c/mingw730/x86_64-730-posix-seh-rt_v5-rev0/mingw64/opt/include
-I/c/mingw730/prerequisites/x86_64-zlib-static/include
-I/c/mingw730/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS='
-I/c/mingw730/x86_64-730-posix-seh-rt_v5-rev0/mingw64/opt/include
-I/c/mingw730/prerequisites/x86_64-zlib-static/include
-I/c/mingw730/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe
-fno-ident -L/c/mingw730/x86_64-730-posix-seh-rt_v5-rev0/mingw64/opt/lib
-L/c/mingw730/prerequisites/x86_64-zlib-static/lib
-L/c/mingw730/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc version 7.3.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)

but, if i remove 'static' keyword all work good

#ifndef NORESULT
#define NORESULT
int $result=0;
#endif


again if I remove the dollar character at the beginning of the identifier all
works for the best

#ifndef NORESULT
#define NORESULT
static int $result=0;
#endif

best regards
Claudio Daffra

[Bug c++/85717] anonymous union in initializer list : do not handle the types correctly

2018-05-11 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85717

--- Comment #4 from claudio daffra  ---

I expect that the compiler regardless of the location of the types 

always gives me the same result, error message or warning

indeed :

# case integer before double :

union 
{
uint64_tinteger ;   
double  real;
} ;

gives me error, about narrowing conversion :

prova.cpp:32:5: error: narrowing conversion of '3.3999e+0' from
'double' to 'uint64_t {aka long long unsigned int}' inside { } [-Wnarrowing]
  t1 = { 1 ,"a",3.4 } ;
 ^

# case double before integer, compile without warning or error me :


union 
{
double  real;
uint64_tinteger ;   
} ;

and about output gives me undefined behavior about integer

t1 = { 1 ,"a",3.4 } ;   
std::cout << t1.real << "\n" ;

t1 = { 1 ,"a",2 } ;
std::cout << t1.integer << "\n" ;   

C:\prj>x.exe
6.6
3
3.4
4611686018427387904

however if it is a normal behavior of c++ or compiler, close it.

[Bug c++/85717] anonymous union in initializer list : do not handle the types correctly

2018-05-10 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85717

--- Comment #2 from claudio daffra  ---

if swap types, result of compilation changes :

   union {
uint64_tinteger ;   
double  real;   
} ;

   union {
double  real;   
uint64_tinteger ;   
} ;

link  stack overflow :

https://stackoverflow.com/questions/50260850/anonymous-union-in-initializer-list-do-not-handle-the-types-correctly

[Bug c++/85717] anonymous union in initializer list : do not handle the types correctly

2018-05-10 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85717

--- Comment #1 from claudio daffra  ---

if swap types, result of compilation changes :

   union {
uint64_tinteger ;   
double  real;   
} ;

   union {
double  real;   
uint64_tinteger ;   
} ;

link  stack overflow :

https://stackoverflow.com/questions/50260850/anonymous-union-in-initializer-list-do-not-handle-the-types-correctly

[Bug c++/85717] New: anonymous union in initializer list : do not handle the types correctly

2018-05-09 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85717

Bug ID: 85717
   Summary: anonymous union in initializer list : do not handle
the types correctly
   Product: gcc
   Version: 5.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daffra.claudio at gmail dot com
  Target Milestone: ---

Created attachment 44100
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44100=edit
anonymous union in initializer list : do not handle the types correctly

anonymous union in initializer list : do not handle the types correctly

when i use initializer list in anonyumouse union, g++ gives this error code
more or less i expected;

C:\prj\cd>g++ src\prova.cpp -o prova.exe -std=c++14
src\prova.cpp: In function 'int main()':
src\prova.cpp:31:5: error: narrowing conversion of
'3.3999e+0' from 'double' to 'uint64_t {aka long long unsigned
int}' inside { } [-Wnarrowing]
  t1 = { 1 ,"a",3.4 } ;
 ^

indeed in a normal way, code below all works o perfectly 

t1.real = 6.6 ;
std::cout << t1.real << "\n" ;

t1.integer = 3 ;
std::cout << t1.integer << "\n" ;

despite result change if i swith union member

union {
uint64_tinteger ;   
double  real;
} ; 

i put

union {
double  real;   
uint64_tinteger ;   
} ; 

source code error  

#include 
#include 
#include 
#include 
#include 

typedef struct  token_s
{
uint8_t sym ;   
std::string tok ;
union {

double  real;
uint64_tinteger ;   
} ;

} token_t ;

int main ( void )
{
assert ( sizeof(uint64_t)==sizeof(double) ) ;

token_t t1 ;

t1.real = 6.6 ;
std::cout << t1.real << "\n" ;

t1.integer = 3 ;
std::cout << t1.integer << "\n" ;

t1 = { 1 ,"a",3.4 } ;   
std::cout << t1.real << "\n" ;

t1 = { 1 ,"a",2 } ;
std::cout << t1.integer << "\n" ;   

return 0 ;
}

[Bug c++/85715] New: internal compiler error: in reshape_init_class ( in anonymous union )

2018-05-09 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85715

Bug ID: 85715
   Summary: internal compiler error: in reshape_init_class ( in
anonymous union )
   Product: gcc
   Version: 5.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daffra.claudio at gmail dot com
  Target Milestone: ---

Created attachment 44099
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44099=edit
error source code to reproduce it

internal compiler error: in reshape_init_class

I have reproduce this error in source code below

C:\prj\cd>g++ src\prova.cpp -o prova.exe -std=c++14
src\prova.cpp: In function 'int main()':
src\prova.cpp:24:5: internal compiler error: in reshape_init_class, at
cp/decl.c:5484
  t1 = { 1,"tok",{ .real=3.4 } ,1,2} ;
 ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://sourceforge.net/projects/mingw-w64> for instructions.

C:\prj\cd>


similar error : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59832


#include 
#include 
#include 
#include 

typedef struct  token_s
{
uint8_t sym ;   
std::string tok ;
union {

uint64_tinteger ;
double  real;   
} ;

uint32_trow ;
uint32_tcol ;
} token_t ;

int main ( void )
{
token_t t1 ;
t1 = { 1,"tok",{ .real=3.4 } ,1,2} ;
wprintf ( L"%d %s %d %d
%d\n",t1.sym,t1.tok.c_str(),t1.integer,t1.row,t1.col ) ;


return 0 ;
}


C:\prj\cd>g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=C:/Qt/Qt5.10.1/Tools/mingw530_32/bin/../libexec/gcc/i686-w64-mingw32/5.3.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../../../src/gcc-5.3.0/configure --host=i686-w64-mingw32
--build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32
--with-sysroot=/c/mingw530/i686-530-posix-dwarf-rt_v4-rev0/mingw32
--with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-shared
--enable-static --disable-multilib --enable-languages=c,c++,fortran,lto
--enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp
--enable-libatomic --enable-lto --enable-graphite --enable-checking=release
--enable-fully-dynamic-string --enable-version-specific-runtime-libs
--disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check
--disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap
--disable-rpath --disable-win32-registry --disable-nls --disable-werror
--disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686
--with-tune=generic --with-libiconv --with-system-zlib
--with-gmp=/c/mingw530/prerequisites/i686-w64-mingw32-static
--with-mpfr=/c/mingw530/prerequisites/i686-w64-mingw32-static
--with-mpc=/c/mingw530/prerequisites/i686-w64-mingw32-static
--with-isl=/c/mingw530/prerequisites/i686-w64-mingw32-static
--with-pkgversion='i686-posix-dwarf-rev0, Built by MinGW-W64 project'
--with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe
-I/c/mingw530/i686-530-posix-dwarf-rt_v4-rev0/mingw32/opt/include
-I/c/mingw530/prerequisites/i686-zlib-static/include
-I/c/mingw530/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2
-pipe -I/c/mingw530/i686-530-posix-dwarf-rt_v4-rev0/mingw32/opt/include
-I/c/mingw530/prerequisites/i686-zlib-static/include
-I/c/mingw530/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS=
LDFLAGS='-pipe -L/c/mingw530/i686-530-posix-dwarf-rt_v4-rev0/mingw32/opt/lib
-L/c/mingw530/prerequisites/i686-zlib-static/lib
-L/c/mingw530/prerequisites/i686-w64-mingw32-static/lib
-Wl,--large-address-aware'
Thread model: posix
gcc version 5.3.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project)

C:\prj\cd>

[Bug c++/59832] [c++11] ICE in reshape_init_class with initializer list

2018-05-09 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59832

claudio daffra  changed:

   What|Removed |Added

 CC||daffra.claudio at gmail dot com

--- Comment #14 from claudio daffra  ---
internal compiler error: in reshape_init_class

I have reproduce this error in source code below

C:\prj\cd>g++ src\prova.cpp -o prova.exe -std=c++14
src\prova.cpp: In function 'int main()':
src\prova.cpp:24:5: internal compiler error: in reshape_init_class, at
cp/decl.c:5484
  t1 = { 1,"tok",{ .real=3.4 } ,1,2} ;
 ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://sourceforge.net/projects/mingw-w64> for instructions.

C:\prj\cd>

#include 
#include 
#include 
#include 

typedef struct  token_s
{
uint8_t sym ;   
std::string tok ;
union {

uint64_tinteger ;
double  real;   
} ;

uint32_trow ;
uint32_tcol ;
} token_t ;

int main ( void )
{
token_t t1 ;
t1 = { 1,"tok",{ .real=3.4 } ,1,2} ;
wprintf ( L"%d %s %d %d
%d\n",t1.sym,t1.tok.c_str(),t1.integer,t1.row,t1.col ) ;


return 0 ;
}

[Bug c++/84289] warning : variabile unitialized, emit right check only with O(1,2,3) optimisation level (in try/catch)

2018-02-10 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84289

--- Comment #2 from claudio daffra  ---
yes, but people expects g++ emit warning , Independent from optimisation
level , referring others simlar bug . can you fix ?

Il 09 feb 2018 00:09, "manu at gcc dot gnu.org" 
ha scritto:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84289
>
> Manuel López-Ibáñez  changed:
>
>What|Removed |Added
> 
> 
>  Status|UNCONFIRMED |RESOLVED
>  CC||manu at gcc dot gnu.org
>  Resolution|--- |DUPLICATE
>
> --- Comment #1 from Manuel López-Ibáñez  ---
> The try-catch creates:
>
>   # n_1 = PHI 
>   # .MEM_2 = PHI <.MEM_4(3), .MEM_12(9)>
>   _15 = n_1;
>
> and PHI is only handled with optimization.
>
> *** This bug has been marked as a duplicate of bug 43361 ***
>
> --
> You are receiving this mail because:
> You reported the bug.

[Bug c++/84289] New: warning : variabile unitialized, emit right check only with O(1,2,3) optimisation level (in try/catch)

2018-02-08 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84289

Bug ID: 84289
   Summary: warning : variabile unitialized, emit right check only
with O(1,2,3) optimisation level (in try/catch)
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daffra.claudio at gmail dot com
  Target Milestone: ---

Created attachment 43376
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43376=edit
file to reproduce error

i use this flags to compile program below :

-Wall -Wextra -pedantic-errors -std=c++11

g++ gives me NO warning, indeed with

-Wall -Wextra -pedantic-errors -std=c++11 -O3

g++ emit right warning

in this example g++ emit correct warning only when is active optimisation level
(123), but not with optimisation 0 or in other way


#include 
#include 
#include 

uint64_t StringToInteger ( std::string str, int _base  )
{
uint64_t n;

try
{
n   = std::stoull ( str,nullptr,_base );
}
catch ( std::invalid_argument )
{
std::cout << "error" ;
}

return n ;
}

int main ( void )
{
std::cout << StringToInteger ( "123",10 ) ;
 return 0 ;
}


in this other example

#include 
#include 
#include 

uint64_t StringToInteger ( std::string str, int _base  )
{
uint64_t n;


return n ;
}

int main ( void )
{
std::cout << StringToInteger ( "123",10 ) ;
 return 0 ;
}

g++ emit warning ! with or without optimisation flags, rightly !

[Bug c++/84062] New: error: no matching function for call to 'std::vector::push_back()

2018-01-26 Thread daffra.claudio at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84062

Bug ID: 84062
   Summary: error: no matching function for call to
'std::vector::push_back()
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daffra.claudio at gmail dot com
  Target Milestone: ---

Created attachment 43251
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43251=edit
source code where error7bug  is generated

as you see in example below, g++ -std=c++11 fails compiler code,
when i assign a default value to a parameter in a struct definition
( i've tested with visual studio 2017 and all works good)
issue has generated in standard vectoru push back member
because it can not recognize struct correclty

g++ -v

Using built-in specs.
COLLECT_GCC=g++
   
COLLECT_LTO_WRAPPER=C:/TDM-GCC-64/bin/../libexec/gcc/x86_64-w64-mingw32/5.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-5.1.0/configure
--build=x86_64-w64-mingw32 --enable-targets=all
--enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp
--enable-lto --enable-graphite --enable-cxx-flags=-DWINPTHREAD_STATIC
--disable-build-with-cxx --disable-build-poststage1-with-cxx
--enable-libstdcxx-debug --enable-threads=posix
--enable-version-specific-runtime-libs --enable-fully-dynamic-string
--enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-ld
--disable-werror --disable-nls --disable-win32-registry --prefix=/mingw64tdm
--with-local-prefix=/mingw64tdm --with-pkgversion=tdm64-1
--with-bugurl=http://tdm-gcc.tdragon.net/bugs
Thread model: posix
gcc version 5.1.0 (tdm64-1) 

source code 

#include 
#include 
#include 
#include 


typedef struct option_s
{
int8_t  parameter  ;   // <-- Works !
// int8_t   parameter = 1 ; <--
ERROR : if i put default parameter, gcc gives me error in : vOption.push_back (
{ 1 }  ) ;  
} option_t ;


class Option
{
public:
std::vector   vOption ;


Option(void) 
{ 
} ;

void add  ( void )
{

vOption.push_back ( { 1 }  ) ;
}


} zzz ;


int main ( void )
{
return 0 ;
}


Error Message

prova.cpp: In member function 'void Option::add()':
prova.cpp:29:32: error: no matching function for call to
'std::vector::push_back()'
 vOption.push_back ( { 1 }  ) ;
^
In file included from
C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/vector:64:0,
 from prova.cpp:5:
   
C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_vector.h:913:7:
note: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&)
[with _Tp = option_s; _Alloc = std::allocator; std::vector<_Tp,
_Alloc>::value_type = option_s]
   push_back(const value_type& __x)
   ^
   
C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_vector.h:913:7:
note:   no known conversion for argument 1 from '' to 'const value_type& {aka const option_s&}'
   
C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_vector.h:931:7:
note: candidate: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp,
_Alloc>::value_type&&) [with _Tp = option_s; _Alloc = std::allocator;
std::vector<_Tp, _Alloc>::value_type = option_s]
   push_back(value_type&& __x)
   ^
   
C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_vector.h:931:7:
note:   no known conversion for argument 1 from '' to 'std::vector::value_type&& {aka option_s&&}'

[Bug c++/56959] New: unable to find string literal operator ‘operator

2013-04-14 Thread daffra.claudio at gmail dot com

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56959

 Bug #: 56959
   Summary: unable to find string literal operator ‘operator
Classification: Unclassified
   Product: gcc
   Version: 4.7.2
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: daffra.clau...@gmail.com


claudio@ubuntu64:~/chtulu linux$ gcc --version
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2

#define strCopyRight   chtulu\
\nprogramming language\
\n[2013] LGPL (2) : daffra.clau...@gmail.com



 const char *s = \n\
 strCopyRight\
 \n\nUsage :\n\
 \nstrProjectName : input file \
 \n\noptions\n\
 \nhelp file: -h \
 \ninput file   : -i input  file name\
 \noutput file  : -o output file name\
 \n; 

main.c: In function ‘void HelpFile()’:
main.c:34:2: error: unable to find string literal operator ‘operator
strProjectName’
-rwxrwxr-x 1 claudio claudio 28532 apr 14 22:47 ch\r
claudio@ubuntu64:~/chtulu linux$

this piece of code (up) compile with error , as you see

this ohter (down) piece of code compile without error :
i must separate strProjectName with space before and after
n.b. same version of gcc in windows tdm64-gcc-4.7.1-3 work good

 const char *s = \n\
 strCopyRight\
 \n\nUsage :\n\
 \n strProjectName  : input file \
 \n\noptions\n\
 \nhelp file: -h \
 \ninput file   : -i input  file name\
 \noutput file  : -o output file name\
 \n;

[Bug c++/56959] unable to find string literal operator ‘operator

2013-04-14 Thread daffra.claudio at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56959



--- Comment #3 from claudio daffra daffra.claudio at gmail dot com 2013-04-14 
22:43:34 UTC ---

no bug, std=c++11


[Bug c++/56883] New: error openmp parallel for order

2013-04-08 Thread daffra.claudio at gmail dot com

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56883

 Bug #: 56883
   Summary: error openmp parallel for order
Classification: Unclassified
   Product: gcc
   Version: 4.7.2
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: daffra.clau...@gmail.com


Created attachment 29831
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=29831
geeratated by compiler

claudio@mint ~/chtulu $ g++ -fopenmp master.cpp -o master
master.cpp: In function ‘built-in’:
master.cpp:179:17: internal compiler error: in expand_gimple_stmt_1, at
cfgexpand.c:2163
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-4.7/README.Bugs for instructions.
Preprocessed source stored into /tmp/ccEQsp0b.out file, please attach this to
your bugreport.


ERROR 

templateclass T
void DimVector ( Vector4d(T) dc, int x,int y,int z,int w )
{
register int i,j,k;
dc.resize(x);
#pragma omp parallel for ordered shared(i,j,k)
for ( i = 0; i  x; ++i) 
{

dc[i].resize(y);
#pragma omp parallel for ordered shared(i,j,k)
for ( j = 0; j  y; ++j) 
{
dc[i][j].resize(z);
#pragma omp parallel for ordered shared(i,j,k)
for (  k = 0; k  z; ++k) 
{
dc[i][j][k].resize(w);
}
}
}
}