Re: NetworkManager C99 compiler requirement for 0.9.10 (and therefore 0.9.9)



On Thu, 2013-02-28 at 04:57 -0500, Pavel Simerda wrote:
Hi all,

I would like to do *occasional* C99-style declarations in the code to avoid ugly hacks when using 
conditionally built code. That means bumping up the compiler requirements to the C99 standard. As we 
currently only target to GCC and possibly LLVM, I don't think it would be a problem.

I will modify the configure.ac to require and use C99, if there are no objections on the list.

Below you can see an example of code that would benefit from moving conditional stuff together.

You can also do:
#if !KERNEL_HACKS
        {
                gboolean link_was_up;

                /* Current kernels may break IPv6 networking when performing this test:
                 *
                 * https://bugzilla.redhat.com/show_bug.cgi?id=886116
                 *
                 * We're therefore disabling it as a hack to preserve connectivity on
                 * kernels that would break it.
                 */
                /* Loopback can be set up and down */
                link_was_up = nm_platform_link_is_up (LO_INDEX);
                g_assert (nm_platform_link_set_up (LO_INDEX));
                g_assert (nm_platform_link_is_up (LO_INDEX));
                g_assert (nm_platform_link_is_connected (LO_INDEX));
        }
#endif

No need to bump the requirements. Or you could move the hacks to their
own separate function.



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