Severity: trivial
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: dchichkov at gmail dot com
The following code, if compiled with '-Wconversion' with GCC 4.8.1:
// gcc conv.c -Wconversion
int main() {
short int a = 1;
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61029
--- Comment #2 from Dmitry Chichkov ---
Ah. Yes. You are correct. It doesn't look like it is being truncated to 0, as
the following code:
#include
#include
int main() {
short int a = SHRT_MIN;
printf("%d\n", a);
a = -a;
p
gnedTo: unassigned at gcc dot gnu dot org
ReportedBy: dchichkov at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44653
--- Comment #1 from dchichkov at gmail dot com 2010-06-24 09:53 ---
Update. Following code produces the correct value:
#include
#include
#include
int main()
{
typedef std::mt19937 eng_t;
typedef std::uniform_real dist_t;
typedef std::variate_generator gen_t;
eng_t eng;
dist_t