Giter VIP home page Giter VIP logo

Comments (8)

raveit65 avatar raveit65 commented on July 29, 2024

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?

from atril.

raveit65 avatar raveit65 commented on July 29, 2024

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

from atril.

lukefromdc avatar lukefromdc commented on July 29, 2024

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));
      | 

from atril.

lukefromdc avatar lukefromdc commented on July 29, 2024

@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

from atril.

correctmost avatar correctmost commented on July 29, 2024

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.

from atril.

raveit65 avatar raveit65 commented on July 29, 2024

@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.

from atril.

raveit65 avatar raveit65 commented on July 29, 2024

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.

from atril.

cwendling avatar cwendling commented on July 29, 2024

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 🤷

from atril.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.