octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FIXMEs in GUI/IDE code


From: John W. Eaton
Subject: Re: FIXMEs in GUI/IDE code
Date: Sun, 6 Jan 2013 10:44:57 -0500

On  6-Jan-2013, Torsten wrote:

| As mentioned above, I think there are more important problems at the
| moment. But it could be a nice feature in the future.
| 
| > /libgui/src/main-window.cc
| > 
| >      6.5  main_window::notice_settings ()
| >      6.6  {
| >      6.7 +  // FIXME -- was this supposed to be configurable in some
| > way?  If so,
| >      6.8 +  // maybe it should be moved back to resource-manager.{h,cc},
| > but not
| >      6.9 +  // as a static variable.
| >     6.10 +  static const char *WIDGET_ICON_SET_PREFIX[] =
| >     6.11 +    {
| >     6.12 +      ":/actions/icons/logo.png",
| >     6.13 +      ":/actions/icons/graphic_logo_",
| >     6.14 +      ":/actions/icons/letter_logo_"
| >     6.15 +    };
| > 
| > I'm guessing you wanted to move the declaration for the array out of a
| > header file so that there aren't multiple inclusions in object code and
| > possible conflicts or duplications.  This one is Torsten's prerogative,
| > but I will make a comment with a word of warning.
| 
| The array is not supposed to be configurable but my intention was to
| bundle constant definitions used in several files in a central place. In
| this case, the array is only used in main-window.cc and the related enum
| in settings-dialog.cc. But since the two parameters are definitely
| belonging together I would like to move the array declaration back to
| ressource-manager.h (without static).

If the definition of this array is put in resource-manager.h with
static, GCC will generate warnings like this:

  In file included from .../octave/libgui/src/main-window.h:46:0,
                   from src/moc-main-window.cc:10:
  .../octave/libgui/src/resource-manager.h: At global scope:
  .../octave/libgui/src/resource-manager.h:39:20: warning: 
'WIDGET_ICON_SET_PREFIX' defined but not used [-Wunused-variable]

for any file that includes resource-mananger.h but that does not use
the array.

Without the static, libgui will fail to link with a series of errors
something like

  
src/.libs/libgui-src.a(src_libgui_src_la-file-editor-tab.o):(.data.rel.local+0x0):
 multiple definition of `WIDGET_ICON_SET_PREFIX'
  
src/.libs/libgui-src.a(src_libgui_src_la-files-dockwidget.o):(.data.rel.local+0x0):
 first defined here

because there will be multiple definitions of the array.

So some other solution is needed.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]