[Bug c++/92659] Suggestions for bitshift

2019-11-26 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC|

[Bug c++/92659] Suggestions for bitshift

2019-11-26 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 --- Comment #10 from Jonny Grant --- (In reply to Jonathan Wakely from comment #8) > Because 5147483647 doesn't fit in an int, so it picks a larger type, because > that's what the standard requires. 1 does fit in an int, so the compiler > picks i

[Bug c++/92659] Suggestions for bitshift

2019-11-26 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 --- Comment #9 from Jonathan Wakely --- (In reply to David Brown from comment #6) > All in all, the whole idea sounds counter-productive to me. If you need > spoon-feeding about the details of C here, you would be better off reading a > book on

[Bug c++/92659] Suggestions for bitshift

2019-11-26 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 --- Comment #8 from Jonathan Wakely --- Because 5147483647 doesn't fit in an int, so it picks a larger type, because that's what the standard requires. 1 does fit in an int, so the compiler picks int, because that's what the standard requires.

[Bug c++/92659] Suggestions for bitshift

2019-11-26 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 --- Comment #7 from Jonny Grant --- (In reply to David Brown from comment #4) > (In reply to Jonny Grant from comment #2) > > (In reply to Xi Ruoyao from comment #1) > > > Is it appropriate? > > > > > > Though on both 32-bit and 64-bit x86 "1ul"

[Bug c++/92659] Suggestions for bitshift

2019-11-26 Thread david at westcontrol dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 --- Comment #6 from David Brown --- (In reply to Xi Ruoyao from comment #3) > (In reply to Jonny Grant from comment #2) > > (In reply to Xi Ruoyao from comment #1) > > > Is it appropriate? > > > > > > Though on both 32-bit and 64-bit x86 "1ul" i

[Bug c++/92659] Suggestions for bitshift

2019-11-26 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 --- Comment #5 from Jonathan Wakely --- (In reply to Xi Ruoyao from comment #3) > I can't find any specification in C standard saying "the bitwidth of long > should >= the bitwidth of size_t". So at least theoretically it may be > insufficient.

[Bug c++/92659] Suggestions for bitshift

2019-11-26 Thread david at westcontrol dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 David Brown changed: What|Removed |Added CC||david at westcontrol dot com --- Comment #

[Bug c++/92659] Suggestions for bitshift

2019-11-26 Thread xry111 at mengyan1223 dot wang
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 --- Comment #3 from Xi Ruoyao --- (In reply to Jonny Grant from comment #2) > (In reply to Xi Ruoyao from comment #1) > > Is it appropriate? > > > > Though on both 32-bit and 64-bit x86 "1ul" is good for a size_t, but I > > believe there is some

[Bug c++/92659] Suggestions for bitshift

2019-11-26 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 --- Comment #2 from Jonny Grant --- (In reply to Xi Ruoyao from comment #1) > Is it appropriate? > > Though on both 32-bit and 64-bit x86 "1ul" is good for a size_t, but I > believe there is some platform where "1ull" is necessary. > > Maybe I'

[Bug c++/92659] Suggestions for bitshift

2019-11-26 Thread xry111 at mengyan1223 dot wang
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 Xi Ruoyao changed: What|Removed |Added CC||xry111 at mengyan1223 dot wang --- Comment #

[Bug c++/92659] Suggestions for bitshift

2019-11-25 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659 Jonathan Wakely changed: What|Removed |Added Keywords||diagnostic Severity|normal