build/clang: fix detection of valid warning compiler flags

clang does not exit with error when it is called with an
unrecognized (warning) option. Instead it just prints
a warning that makes the configure script believe the
warning is supported. Later, during build we might pass
-Werror, which causes clang to fail due to unrecognized
arguments.

Fix the script to detect compiler warnings by passing
'-Werror=unknown-warning-option', which lets clang fail too.

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit d576ab17b64a9f673195988d0a3c3286ed460f3d)
c-e: fix passing wrong enum type to gtk_widget_override_background_color()

This had no real effect, because both GTK_STATE_NORMAL
and GTK_STATE_FLAG_NORMAL have the numerical value 0.

clang warns:
    make[5]: Entering directory `./network-manager-applet/src/connection-editor'
      CC       nm_connection_editor-page-ip4.o
    page-ip4.c:730:63: error: implicit conversion from enumeration type 'GtkStateType' to different enumeration type 'GtkStateFlags' [-Werror,-Wenum-conversion]
            gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_NORMAL, &rgba);
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                         ^~~~~~~~~~~~~~~~

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit 3fc750af4624dbc74290513f41bd9c0ea21c6853)
build: add cscope.files to gitignore

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit 5f1f047c82ef9fb1c4c7b4ffcec7d9542721f00f)
build: rename nm-gvaluearray-compat.h to nm-glib-compat.h

We need more glib compatibility hacks. Rename the file to
give it a wider use.

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit 86a5c78737ff134774dffd56863f089ff26de3cd)
all: add compatibility macros to ignore deprecation warnings for clang

For clang, the defines G_GNUC_BEGIN_IGNORE_DEPRECATIONS and
G_GNUC_END_IGNORE_DEPRECATIONS are not working. Redefine them
for clang in our glib compatibility wrapper.

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit e119e741cd5e549f5bb1ad65260a618de972dc09)
modem: fix type of modem capabilities when creating mobile wizard

Fixes: f22f23ddb9d8a767e78040e389fa7250f1f79454
Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit a94bab72245828a60f20e0580283a7f08e316332)
gconf-helpers: remove unused variable

Fixes: 163a2b41ac174d1a2b840d9f4b15721877af96bb
Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit 91a059421d53a59d3d232757396022c5f0918971)
build: fix typo in inclusion guard

clang warns:

    make[4]: Entering directory `./network-manager-applet/src'
      CC       nm_applet-applet.o
    In file included from applet.c:88:
    ./applet-vpn-request.h:23:9: error: 'APPLET_VPN_REQEUST_H' is used as a header guard here, followed by #define of a different macro [-Werror,-Wheader-guard]
    #ifndef APPLET_VPN_REQEUST_H
            ^~~~~~~~~~~~~~~~~~~~
    ./applet-vpn-request.h:24:9: note: 'APPLET_VPN_REQUEST_H' is defined here; did you mean 'APPLET_VPN_REQEUST_H'?
    #define APPLET_VPN_REQUEST_H
            ^~~~~~~~~~~~~~~~~~~~
            APPLET_VPN_REQEUST_H

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit de47edb1cc4433bfa224e907f3cf12b2e2fa72b8)
applet: fix initialization of value from wrong enum type

This bug has no real consequences as NM_VPN_SERVICE_STATE_UNKNOWN
and NM_VPN_CONNECTION_STATE_UNKNOWN are both numerically zero.

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit 1006f51352b4809ed4d174e9990e87cd1aba8778)
build: fix compiler warning about duplicate const specifier

clang warns:

    make[4]: Entering directory `./network-manager-applet/src'
      CC       nm_applet-ap-menu-item.o
    ap-menu-item.c:188:7: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]
    const const char *
          ^~~~~~

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit 990afe4fd86fc9f304641b521d25430db8e2b16f)
gconf-helpers: remove commented-out code (#if UNUSED)

These code paths are now disabled for 6 years since
2a4aed586c87b7846a5b890955b97319bebf2674 . Just remove them.

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit e6ed12c032a2af647a53fb85351dacb8c22f54f3)
build: update m4/compiler_warnings.m4

Update m4 macro from current NetworkManager master branch;
with one difference: keep also -Wstrict-prototypes (which
NM does not enable).

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit 50f4b91343cada1b96a548abfcf09d08bbef2141)
all: merge branch 'th/bgo739246_clang' (bgo #739246)

Fixes for compilation with clang and several issues that surfaced
due to new complier warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=739246

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit b75fc2c67503a5f76036f96033f29f74ab5e62a9)
utils: add macros to suppress compiler warnings

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit a6d9842cd6117f7d21b41c26e065208570c7c70e)
gconf-helpers: suppress deprecated warning for gnome-keyring-1

libgnome-keyring is marked as deprecated in favour of libsecret.
We only use it for the legacy gconf-helpers. That code will be
removed in the future, so don't bother an just suppress the
deprecation warning.

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit ad3b90cf877f444e57ffa9b55e8325cac74b1ed3)