On Mon, 2013-05-13 at 17:50 +0200, Éloi Rivard wrote: > I am working with -Wall -Wno-deprecated-declarations, I will see later > for gtk deprecation warnings. > I am currently working on warning suppression. There is a lot of > unused functions There are just one or two cases I know of where functions are there for use from a debugger, or when inserting debug statements - well, only one that I can name immediately - it is a show_type() or some such, which gets the name of a gtk type. Such things should be (perhaps are) always marked as being for debugging.
> and variables, I can suppress some things, but I just comment some > others, because I don't know if you plan to use theme someday, in this > case I set a tag UNUSED to allow you to find it. I can also see a lot > of #ifdef 0. Maybe some cleanup would be welcome, for readability ? On balance I think the clean up would be good - it will be enough if I look over the things you delete and copy out anything that looks useful, perhaps restoring it with some more self-explanatory #ifdef rather than the #if 0, indeed I think there are a few bits of #ifdef there that could get activated one day - a bug in the counting of columns in GtkTextBuffer which may be fixed in gtk3 for example. > > A lot of warning concern typecasting indeed, for data storage for > example. There is some very bad code about type length (int vs char in > 64 archs for instance), but I will solve it in a second time since it > is less trivial. > > And there some cases like the original one of this email, implicit > function declarations. Maybe that will prevent some other crashes like > yours. Sounds good! Richard > > > > 2013/5/13 Richard Shann <[email protected]> > On Mon, 2013-05-13 at 09:08 +0200, Éloi Rivard wrote: > > That makes sense. I didn't event understand why it compiled > at all :) > > > It is very common for it not to matter, and not uncommon for > it to fail > consistently, but I am surprised at seeing apparently random > crashes - > on one run the label of one menu item was a string that > belonged > somewhere else altogether. I still haven't seen any crashes > since, but I > haven't done any serious music typesetting. > > In this case, if you don't give the prototype for a function > it assumes > the function returns an int. This only matters if it actually > returns > something larger - I am guessing that a pointer on a 64-bit > architecture > might have its top bits corrupted by the optimizer squeezing > something > else into what it thinks are unused bits in a register. > > > > I can work on warning suppression, that would maybe make the > code > > safer. > > > There are one or two cases which I didn't get to the bottom of > - type > conflicts with built-in functions. And a bunch of warnings > that arise > from code inside macros that I couldn't quickly fix. > And then, most worryingly there are complaints now about > storing > pointers in integers which I haven't looked closely into, but > I imagine > could be tricky to fix. > > > > > > > > > There is a lot of warnings about gtk. > > > Are you referring to the default warning level or -Wall? > > Richard > > > > > > > > > > 2013/5/12 Richard Shann <[email protected]> > > Eloi, > > > > I was getting a crash when doing File->New. The > crash vanished > > when I > > turned the optimizer off. I re-compiled and noticed > that > > keymapio.c had > > some warnings about prototypes so I put the headers > in > > keymapio.h, now > > the crash has gone away. Before finding this > consistent crash > > I was just > > getting occasional crashes on startup, never the > same twice. > > Denemo used to be full of warnings on compile, but I > have been > > reducing > > them whenever I work on a file if I can; I hope this > is > > another case > > where it has paid off and that we don't have some > threading > > bug lurking > > in the code. > > Below is the backtrace FWIW. > > > > Richard > > > > #2 0x00000000004b842b in add_ui ( > > menupath=0xffffffffd802a010 <Address > 0xffffffffd802a010 > > out of > > bounds>, > > after=0x0, name=0x0) > at ../../denemo/src/keyboard.c:195 > > #3 0x00000000004b886c in create_command > (is_script=<value > > optimized > > out>, > > name=0x7fffd802a0b0 "ScoreTitle", label=<value > optimized > > out>, > > scheme=0x7fffd8033ae0 ";;;ScoreTitle\n(let ((tag > > \"ScoreTitle\") > > (title ScoreTitle::params))\n\t(define > (blank-title)\n\t\t > > \t(if (not > > (d-DirectiveGet-header-postfix tag))\n\t\t\t\t(begin > \n\t\t\t > > \t > > \t(d-DirectivePut-header-override tag 0) \n\t\t\t > \t"..., > > tooltip=<value > > optimized out>, hidden=0, after=0x0, > > menupath=0x0, > > fallback=0xffffffffd802a010 <Address > 0xffffffffd802a010 > > out of > > bounds>, > > menupaths=0x0, merge=1) > at ../../denemo/src/keyboard.c:279 > > #4 0x00000000004d9a2f in parseScripts > (filename=<value > > optimized out>, > > interactive=<value optimized out>) > > at ../../denemo/src/keymapio.c:56 > > #5 parseCommands (filename=<value optimized out>, > > interactive=<value optimized out>) > > at ../../denemo/src/keymapio.c:213 > > #6 parseKeymap (filename=<value optimized out>, > > interactive=<value optimized out>) > > at ../../denemo/src/keymapio.c:230 > > #7 load_xml_keymap (filename=<value optimized out>, > > interactive=<value optimized out>) > > at ../../denemo/src/keymapio.c:294 > > #8 0x000000000046cd86 in instantiate_script > (action=0xfd5960) > > ---Type <return> to continue, or q <return> to > quit--- > > at ../../denemo/src/view.c:8003 > > #9 0x000000000046d0e5 in activate_script > (action=0xfd5960, > > param=<value optimized out>) > > at ../../denemo/src/view.c:8082 > > #10 0x000000000046d248 in scheme_script_callback ( > > script=<value optimized out>, > params=0x7fffdd149d80) > > at ../../denemo/src/view.c:1080 > > > > > > > > _______________________________________________ > > Denemo-devel mailing list > > [email protected] > > https://lists.gnu.org/mailman/listinfo/denemo-devel > > > > > > > > -- > > Éloi Rivard - [email protected] > > > > « On perd plus à être indécis qu'à se tromper. » > > > > > > > > > -- > Éloi Rivard - [email protected] > > « On perd plus à être indécis qu'à se tromper. » > _______________________________________________ Denemo-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/denemo-devel
