Bug 387125 - loss of data warnings with gsl_parser.c
Summary: loss of data warnings with gsl_parser.c
Status: RESOLVED LATER
Alias: None
Product: LabPlot2
Classification: Applications
Component: general (show other bugs)
Version: latest
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Stefan Gerlach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-19 18:11 UTC by uwestoehr
Modified: 2017-12-17 16:47 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description uwestoehr 2017-11-19 18:11:30 UTC
I get:

4>D:/LabPlot/src/gsl_parser.c(1086): warning C4242: '=': conversion from 'int' to 'yytype_int16', possible loss of data
4>backend/gsl/parser.y(124): warning C4777: 'printf' : format string '%Iu' requires an argument of type 'unsigned __int64', but variadic argument 2 has type 'std::size_t'
4>  backend/gsl/parser.y(124): note: the sizes of types 'std::size_t' and 'unsigned __int64' might differ on other platforms
4>  backend/gsl/parser.y(124): note: consider using '%zu' in the format string
4>backend/gsl/parser.y(343): warning C4242: '=': conversion from 'int' to 'char', possible loss of data
4>backend/gsl/parser.y(373): warning C4710: 'int printf(const char *const ,...)': function not inlined
4>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\../ucrt/stdio.h(944): note: see declaration of 'printf'
4>  Generating Code...
4>d:\labplot\src\gsl_parser.c(1486): warning C4702: unreachable code
Comment 1 Stefan Gerlach 2017-11-19 19:02:13 UTC
ok. Tried to fix these warnings in the latest commit. Please check if they are still present.
Comment 2 uwestoehr 2017-11-19 20:27:38 UTC
Now I get:

2>D:/LabPlot/src/gsl_parser.c(1086): warning C4242: '=': conversion from 'int' to 'yytype_int16', possible loss of data
2>backend/gsl/parser.y(277): warning C4242: '=': conversion from 'int' to 'char', possible loss of data
2>backend/gsl/parser.y(344): warning C4242: '=': conversion from 'int' to 'char', possible loss of data
Comment 3 Stefan Gerlach 2017-11-19 21:31:17 UTC
Git commit e2bbf36764c1ffadb6d2de492f3b5f6cf57acd0b by Stefan Gerlach.
Committed on 19/11/2017 at 21:30.
Pushed by sgerlach into branch 'master'.

FIXED-IN: 2.5

M  +2    -2    src/backend/gsl/parser.y

https://commits.kde.org/labplot/e2bbf36764c1ffadb6d2de492f3b5f6cf57acd0b
Comment 4 uwestoehr 2017-11-19 21:55:01 UTC
I get now:

2>C:\CraftRoot\include\msvc\stdlib.h(53): warning C4255: 'random': no function prototype given: converting '()' to '(void)'
2>C:\CraftRoot\labplot\src\backend\gsl\parser.h(42): warning C4255: 'fnct': no function prototype given: converting '()' to '(void)'
2>C:\CraftRoot\labplot\src\backend\gsl\parser.h(49): warning C4820: 'parser_var': '6' bytes padding added after data member 'name'
2>C:\CraftRoot\labplot\src\backend\gsl\parser.h(53): warning C4255: 'func_t': no function prototype given: converting '()' to '(void)'
2>C:\CraftRoot\labplot\src\backend\gsl\parser.h(62): warning C4820: 'symrec': '4' bytes padding added after data member 'type'
2>C:\CraftRoot\labplot\src\backend\gsl\parser.h(66): warning C4255: 'init_table': no function prototype given: converting '()' to '(void)'
2>C:\CraftRoot\labplot\src\backend\gsl\parser.h(67): warning C4255: 'delete_table': no function prototype given: converting '()' to '(void)'
2>C:\CraftRoot\labplot\src\backend\gsl\parser.h(68): warning C4255: 'parse_errors': no function prototype given: converting '()' to '(void)'
Comment 5 uwestoehr 2017-11-21 23:03:21 UTC
Reopening because I get now this:

2>D:/LabPlot/src/gsl_parser.c(1086): warning C4242: '=': conversion from 'int' to 'yytype_int16', possible loss of data
Comment 6 Stefan Gerlach 2017-11-22 09:45:09 UTC
gsl_parser.c is auto-generated from parser.y. Can you show me at least the line 1086 of your gsl_parser.c?
Comment 7 uwestoehr 2017-11-22 22:44:38 UTC
> Can you show me at least the line 1086 of your gsl_parser.c?

This is line 1086:
  *yyssp = yystate;

Here is the context:
/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
 yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed.  So pushing a state here evens the stacks.  */
  yyssp++;

 yysetstate:
  *yyssp = yystate;

  if (yyss + yystacksize - 1 <= yyssp)
Comment 8 uwestoehr 2017-11-26 22:18:20 UTC
Now I get more:

1>D:/LabPlot/src/gsl_parser.c(1087): warning C4242: '=': conversion from 'int' to 'yytype_int16', possible loss of data
1>d:\labplot\src\gsl_parser.c(1487): warning C4702: unreachable code
Comment 9 Stefan Gerlach 2017-12-17 16:47:26 UTC
this code is generated from bison and needs to be addressed upstream.