Closed raveit65 closed 5 months ago
I checked building all packages with gcc14 for fedora rawhide and i could fix most packages. Only atril failed to build because of -Wincompatible-pointer-types
warning which is treat as an error with gcc14.
@cwendling @mate-desktop/core-team
Can you please take a look at it?
I got a FTBFS from Fedora Release Engineering group. Atril will be removed from fedora when we don't fix the build warning. https://bugzilla.redhat.com/show_bug.cgi?id=2260996 Sorry, i don't have the knowledge to fix it. Please help. @zhuyaliang @lukefromdc @cwendling @yetist @mate-desktop/core-team
I do not have gcc 14 yet on Debian Unstable, but the warnings from the logs are a conflict between gchar
and const gchar
in lines 637 and 648 of epub-document.c
/usr/include/glib-2.0/glib/gstrfuncs.h:383:55: note: expected 'gchar ' {aka 'char '} but argument is of type 'const gchar ' {aka 'const char '} 383 | guint g_strv_length (gchar **str_array);
changing line 632 from const gchar mimetypes[] = {"application/epub+zip", "application/x-booki+zip", NULL}; to gchar mimetypes[] = {"application/epub+zip", "application/x-booki+zip", NULL};
stops the build warnings and (on gcc 13 anyway) the build now completes. Runtime behavior same as before, note that under wayland opening epubs fails with a warning about not being able to create an OpenGL context on that backend.
We still get these build warnings, unchanged either way. No idea if these also shut down a gcc 14 build though:
In function 'setup_document_content_list',
inlined from 'epub_document_load' at epub-document.c:1771:34:
epub-document.c:1048:26: warning: array subscript 'contentListNode {aka struct _contentListNode}[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds=]
1048 | newnode->key = (gchar*)xml_get_data_from_node(itemrefptr,XML_ATTRIBUTE,(xmlChar*)"idref");
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
epub-document.c:1047:40: note: object of size 8 allocated by 'g_malloc0'
1047 | contentListNode *newnode = g_malloc0(sizeof(newnode));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
epub-document.c:1064:32: warning: array subscript 'contentListNode {aka struct _contentListNode}[0]' is partly outside array bounds of 'contentListNode[0]' {aka 'struct _contentListNode[]'} [-Warray-bounds=]
1064 | g_free (newnode->key);
| ~~~~~~~^~~~~
epub-document.c:1047:40: note: object of size 8 allocated by 'g_malloc0'
1047 | contentListNode *newnode = g_malloc0(sizeof(newnode));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
epub-document.c:1075:28: warning: array subscript 'contentListNode {aka struct _contentListNode}[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds=]
1075 | newnode->value = g_filename_to_uri(absolutepath->str,NULL,&err);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
epub-document.c:1047:40: note: object of size 8 allocated by 'g_malloc0'
1047 | contentListNode *newnode = g_malloc0(sizeof(newnode));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
epub-document.c:1078:25: warning: array subscript 'contentListNode {aka struct _contentListNode}[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds=]
1078 | if ( newnode->value == NULL )
| ~~~~~~~^~~~~~~
epub-document.c:1047:40: note: object of size 8 allocated by 'g_malloc0'
1047 | contentListNode *newnode = g_malloc0(sizeof(newnode));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
epub-document.c:1086:28: warning: array subscript 'contentListNode {aka struct _contentListNode}[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds=]
1086 | newnode->index = indexcounter++ ;
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
epub-document.c:1047:40: note: object of size 8 allocated by 'g_malloc0'
1047 | contentListNode *newnode = g_malloc0(sizeof(newnode));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
epub-document.c:1080:32: warning: array subscript 'contentListNode {aka struct _contentListNode}[0]' is partly outside array bounds of 'contentListNode[0]' {aka 'struct _contentListNode[]'} [-Warray-bounds=]
1080 | g_free (newnode->key);
| ~~~~~~~^~~~~
epub-document.c:1047:40: note: object of size 8 allocated by 'g_malloc0'
1047 | contentListNode *newnode = g_malloc0(sizeof(newnode));
|
@raveit65 , your fix also works with (at least with gcc-13), with behavior identical to what I tested. You can open a PR or I can do it, whichever is easier
In function 'setup_document_content_list', inlined from 'epub_document_load' at epub-document.c:1771:34: epub-document.c:1048:26: warning: array subscript 'contentListNode {aka struct _contentListNode}[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds=] 1048 | newnode->key = (gchar*)xml_get_data_from_node(itemrefptr,XML_ATTRIBUTE,(xmlChar*)"idref");
I have a fix for these newnode
warnings as part of https://github.com/mate-desktop/atril/pull/600.
@raveit65 , your fix also works with (at least with gcc-13), with behavior identical to what I tested. You can open a PR or I can do it, whichever is easier
Ok, i will open a PR.
In function 'setup_document_content_list', inlined from 'epub_document_load' at epub-document.c:1771:34: epub-document.c:1048:26: warning: array subscript 'contentListNode {aka struct _contentListNode}[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds=] 1048 | newnode->key = (gchar*)xml_get_data_from_node(itemrefptr,XML_ATTRIBUTE,(xmlChar*)"idref");
I have a fix for these
newnode
warnings as part of #600.
Cool, i will test your PR. Note those warnings will not treat as errors with gcc14, but good have fix them.
Note those warnings will not treat as errors with gcc14, but good have fix them.
Ironically enough, those show an actual bad issue, and the blocking incompatible ones don't :shrug:
Expected behaviour
Succesful build on fedora rawhide
Actual behaviour
Latest 1.26.2 release failed to build on fedora rawhide
Steps to reproduce the behaviour
Latest 1.26.2 release failed to build on fedora rawhide. from https://kojipkgs.fedoraproject.org//work/tasks/8848/112258848/build.log
For some reason the build warning will be treat as error in rawhide, but i have to deal with it. The warning is caused by this commit https://github.com/mate-desktop/atril/commit/39ba86c9d50b614483152335aa22ee83ac2af02e PR was without CI and build logs ! https://github.com/mate-desktop/atril/pull/571 In 1.26 branch we see the warnings in travis-ci logs https://app.travis-ci.com/github/mate-desktop/atril/jobs/601205067#L1813 Reverting that commit clearly removes the warnings. Locally i fixed the warnings like this.
@cwendling @mate-desktop/core-team Is this a valid fix? If yes , i will create a PR.
MATE general version
1.26
Package version
1.26.2
Linux Distribution
Fedora rawhide
Link to bugreport of your Distribution (requirement)
I do not file out report against myself