Bug #1649

CtrlCore: 'CurrentTime' macro redefined in GtkX11Util.cpp file

Added by Sender Ghost about 7 years ago. Updated about 7 years ago.

Status:NewStart date:02/23/2017
Priority:NormalDue date:
Assignee:Miroslav Fidler% Done:

0%

Category:CtrlCoreSpent time:-
Target version:-

Description

The following warning was found on FreeBSD 10.3 (GTK+ 2.24.29, libX11 1.6.4, xproto 7.0.31) with using LLVM/Clang 3.4.1 (and 3.9.1) compiler:

In file included from <...>/uppsrc/CtrlCore/GtkX11Util.cpp:15:
In file included from /usr/local/include/gtk-2.0/gdk/gdkx.h:32:
In file included from /usr/local/include/X11/Xlib.h:44:
/usr/local/include/X11/X.h:139:9: warning: 'CurrentTime' macro redefined
#define CurrentTime          0L /* special Time */
        ^
<...>/uppsrc/CtrlCore/GtkX11Util.cpp:13:9: note: previous definition is here
#define CurrentTime XCurrentTime
        ^
1 warning generated.

Reference links:
https://github.com/ultimatepp/mirror/blob/2b60bd8e064361c4470c6c2d881b3b82a8f38835/uppsrc/CtrlCore/GtkX11Util.cpp#L15
https://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkx.h?h=2.24.29#n32
https://cgit.freedesktop.org/xorg/lib/libX11/tree/include/X11/Xlib.h?id=libX11-1.6.4#n44
https://cgit.freedesktop.org/xorg/proto/xproto/tree/X.h?id=xproto-7.0.31#n139
https://github.com/ultimatepp/mirror/blob/2b60bd8e064361c4470c6c2d881b3b82a8f38835/uppsrc/CtrlCore/GtkX11Util.cpp#L13

History

#1 Updated by Sender Ghost about 7 years ago

  • Assignee set to Miroslav Fidler

The -Wunused-macros compiler's option returned following warnings for uppsrc/CtrlCore/GtkX11Util.cpp file:
GCC 4.9.4:

<...>/uppsrc/CtrlCore/GtkX11Util.cpp:13:0: warning: macro "CurrentTime" is not used [-Wunused-macros]
 #define CurrentTime XCurrentTime
 ^
<...>/uppsrc/CtrlCore/GtkX11Util.cpp:12:0: warning: macro "Picture" is not used [-Wunused-macros]
 #define Picture     XPicture
 ^

Clang 3.4.1:
<...>/uppsrc/CtrlCore/GtkX11Util.cpp:13:9: warning: macro is not used [-Wunused-macros]
#define CurrentTime XCurrentTime
        ^
In file included from <...>/uppsrc/CtrlCore/GtkX11Util.cpp:15:
In file included from /usr/local/include/gtk-2.0/gdk/gdkx.h:32:
In file included from /usr/local/include/X11/Xlib.h:44:
/usr/local/include/X11/X.h:139:9: warning: 'CurrentTime' macro redefined
#define CurrentTime          0L /* special Time */
        ^
<...>/uppsrc/CtrlCore/GtkX11Util.cpp:13:9: note: previous definition is here
#define CurrentTime XCurrentTime
        ^
<...>/uppsrc/CtrlCore/GtkX11Util.cpp:12:9: warning: macro is not used [-Wunused-macros]
#define Picture     XPicture
        ^
3 warnings generated.

Looks like, the CurrentTime define was available in X.h file from 2003 year (or earlier in the other version control system):
https://cgit.freedesktop.org/xorg/proto/xproto/tree/X.h?id=ee0a1a43dc707f960e637fdf2118723e4de0a55d#n119
https://cgit.freedesktop.org/xorg/proto/xproto/log/X.h

Nevertheless, the Picture and CurrentTime defines was added to uppsrc/CtrlCore/GtkX11Util.cpp file for some purpose (in 5718 and 5721 revisions).

Overall, this is just a warning messages, about which I reported here. Looks like, they didn't cause issue(s) and may be ignored, if there are some use case(s) for such define(s) in different environment.

Also available in: Atom PDF