[Desktop-packages] [Bug 1758373] Re: bison -Wconversion warning

2018-03-23 Thread Amr Ibrahim
In the future, please use `ubuntu-bug package-name` to report bugs. Thanks.
https://help.ubuntu.com/dev/ubuntu-help/report-ubuntu-bug.html.en

** Package changed: gnome-settings-daemon (Ubuntu) => bison (Ubuntu)

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gnome-settings-daemon in Ubuntu.
https://bugs.launchpad.net/bugs/1758373

Title:
  bison -Wconversion warning

Status in bison package in Ubuntu:
  New

Bug description:
  I wish to use the -Wconversion at gcc (the warnings are instructive
  for me, and they already taught me a lot), but then:

  $ bash bison_conversion_bug.sh 
  y.tab.c: In function ‘yyparse’:
  y.tab.c:1023:12: warning: conversion to ‘yytype_int16 {aka short int}’ from 
‘int’ may alter its value [-Wconversion]
 *yyssp = yystate;
  ^~~
  y.tab.c:1028:25: warning: conversion to ‘long unsigned int’ from ‘long int’ 
may change the sign of the result [-Wsign-conversion]
 YYSIZE_T yysize = yyssp - yyss + 1;
   ^
  $

  I get this problem even in an almost empty grammar and minimal C
  source frame for it, see the attachment: an example for minimal
  grammar and minimal C frame ALREADY providing the error.

  This is the error in case of my Ubuntu 18.04 ( bison --version =
  3.0.4, gcc --version = (Ubuntu 7.3.0-12ubuntu1) 7.3.0).

  I could try Debian jessie, where I get exactly the same error at
  exactly the same line position ( bison --version = 3.0.2, gcc
  --version = (Debian 4.9.2-10+deb8u1) 4.9.2).

  MY SUGGESTION: IF the bison developers are sure, that "yystate" and
  "yyssp - yyss + 1" will always fit into "short int" or "long unsigned
  int", THEN an explicit casting could be a solution.  HOWEVER in case
  of "yystate" it would be much more relaxing to make a decision whether
  it should be an "int" or "short int".

  The compilation commands are:

  CCOPTS=''
  CCOPTS+=' -std=c11'
  CCOPTS+=' -Og -g'
  CCOPTS+=' -Wabi'
  CCOPTS+=' -Wfatal-errors'
  CCOPTS+=' -Wall'
  CCOPTS+=' -Wextra'
  CCOPTS+=' -Wreturn-type'
  CCOPTS+=' -Wconversion'  ### bison has 2 conversion errors
  CCOPTS+=' -fexceptions'
  CCOPTS+=' -pedantic-errors'
  CCOPTS+=' -fmax-errors=1'

  rm -f y.output y.tab.h y.tab.c y.tab.o
  bison --yacc --verbose -d "EXAMPLE_GIVEN_IN_THE_ATTACHMENT.y"
  gcc -c ${CCOPTS} y.tab.c

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bison/+bug/1758373/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp


[Desktop-packages] [Bug 1758373] Re: bison -Wconversion warning

2018-03-23 Thread Péter Prőhle
HELP!  I adjusted at the beginning of the bug report, that this is NOT a
gnome-settings-daemon bug, BUT a bison bug, ... there was a possibility
TO CHANGE THE PACKAGE WHAT IS AFFECTED, I do not know why it changed
back to gnome-settings-daemon?

Please, somebody who has enough right for this, change it to bison.
Thanks.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gnome-settings-daemon in Ubuntu.
https://bugs.launchpad.net/bugs/1758373

Title:
  bison -Wconversion warning

Status in gnome-settings-daemon package in Ubuntu:
  New

Bug description:
  I wish to use the -Wconversion at gcc (the warnings are instructive
  for me, and they already taught me a lot), but then:

  $ bash bison_conversion_bug.sh 
  y.tab.c: In function ‘yyparse’:
  y.tab.c:1023:12: warning: conversion to ‘yytype_int16 {aka short int}’ from 
‘int’ may alter its value [-Wconversion]
 *yyssp = yystate;
  ^~~
  y.tab.c:1028:25: warning: conversion to ‘long unsigned int’ from ‘long int’ 
may change the sign of the result [-Wsign-conversion]
 YYSIZE_T yysize = yyssp - yyss + 1;
   ^
  $

  I get this problem even in an almost empty grammar and minimal C
  source frame for it, see the attachment: an example for minimal
  grammar and minimal C frame ALREADY providing the error.

  This is the error in case of my Ubuntu 18.04 ( bison --version =
  3.0.4, gcc --version = (Ubuntu 7.3.0-12ubuntu1) 7.3.0).

  I could try Debian jessie, where I get exactly the same error at
  exactly the same line position ( bison --version = 3.0.2, gcc
  --version = (Debian 4.9.2-10+deb8u1) 4.9.2).

  MY SUGGESTION: IF the bison developers are sure, that "yystate" and
  "yyssp - yyss + 1" will always fit into "short int" or "long unsigned
  int", THEN an explicit casting could be a solution.  HOWEVER in case
  of "yystate" it would be much more relaxing to make a decision whether
  it should be an "int" or "short int".

  The compilation commands are:

  CCOPTS=''
  CCOPTS+=' -std=c11'
  CCOPTS+=' -Og -g'
  CCOPTS+=' -Wabi'
  CCOPTS+=' -Wfatal-errors'
  CCOPTS+=' -Wall'
  CCOPTS+=' -Wextra'
  CCOPTS+=' -Wreturn-type'
  CCOPTS+=' -Wconversion'  ### bison has 2 conversion errors
  CCOPTS+=' -fexceptions'
  CCOPTS+=' -pedantic-errors'
  CCOPTS+=' -fmax-errors=1'

  rm -f y.output y.tab.h y.tab.c y.tab.o
  bison --yacc --verbose -d "EXAMPLE_GIVEN_IN_THE_ATTACHMENT.y"
  gcc -c ${CCOPTS} y.tab.c

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1758373/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp