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>
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>
build: add cscope.files to gitignore

Signed-off-by: Thomas Haller <thaller@redhat.com>
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>
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>
modem: fix type of modem capabilities when creating mobile wizard

Fixes: f22f23ddb9d8a767e78040e389fa7250f1f79454
Signed-off-by: Thomas Haller <thaller@redhat.com>
gconf-helpers: remove unused variable

Fixes: 163a2b41ac174d1a2b840d9f4b15721877af96bb
Signed-off-by: Thomas Haller <thaller@redhat.com>
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>
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>
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>
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>
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>
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>