Skip to content

Fix small issues 2#209

Merged
brarcher merged 16 commits intolibcheck:masterfrom
mikkoi:fix-small-issues-2
Sep 9, 2019
Merged

Fix small issues 2#209
brarcher merged 16 commits intolibcheck:masterfrom
mikkoi:fix-small-issues-2

Conversation

@mikkoi
Copy link
Copy Markdown
Contributor

@mikkoi mikkoi commented Aug 12, 2019

Fix several minor issues, needed before we go into fixing the rest of the build for POSIX compatibles.

@mikkoi mikkoi changed the title Fix small issues 2 Fix small issues 2 - NOT FOR MERGING Aug 28, 2019
@mikkoi mikkoi force-pushed the fix-small-issues-2 branch from 4b72c2a to ade548e Compare September 1, 2019 20:05
@mikkoi mikkoi changed the title Fix small issues 2 - NOT FOR MERGING Fix small issues 2 Sep 1, 2019
Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
@mikkoi mikkoi force-pushed the fix-small-issues-2 branch from ade548e to ed6ddb4 Compare September 2, 2019 17:06
Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Function _exit(int) is included in unistd.h. Also fork() is here.
Functions exit(int) (C89) and _Exit(int) (C99) are in stdlib.h.

Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
If we don't undefine the macro, it will enter the user's namespace.
This macro is only for our internal use.
Otherwise it would have the "CK_" prefix.

Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
It is a CMake best practice to include file 'CTest'
in the project main file and then use option
'BUILD_TESTING' (defined in 'CTest') to enable or disable
building the tests. BUILD_TESTING is ON by default.

https://cmake.org/cmake/help/v3.9/module/CTest.html?highlight=build_testing
https://cmake.org/cmake/help/v3.9/command/add_test.html?highlight=build_testing

Option CHECK_ENABLE_TESTS is deprecated.
Because it is on by default, deprecation warning is only shown
to user when user explicitly turns CHECK_ENABLE_TESTS off.

Suggesting to remove the option by release 0.15.0.

Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
@mikkoi mikkoi force-pushed the fix-small-issues-2 branch from e1faee2 to e17c6f7 Compare September 8, 2019 08:22
Restrict variable replacement to references of the form @var@.
This is useful for configuring scripts that also use ${VAR} syntax.
Adding @only is precautionary action to prevent future bugs.

Attn. cmake/config.h.in contains ${VAR} in #cmakedefine clauses!

How to use CMake variable substitution.

Wrong:

    #if @HAVE_FORK@
        [..]
    #endif

Because this will result as:

    #if 1
        [..]
    #endif

Better:

    /* Imported CMake variables created during build. */
    #cmakedefine HAVE_FORK 1

    #ifdef HAVE_FORK
        [..]
    #endif

Because this will result as:

    /* Imported CMake variables created during build. */
    #define HAVE_FORK 1

    #ifdef HAVE_FORK
        [..]
    #endif

Or:

    /* Imported CMake variables created during build. */
    /* #undef HAVE_FORK */
    [..]

This is more readable. Now we know which decision actually
was taken.

If you need to pass the parameter to the definition,
it is just as easy:

    /* Imported CMake variables created during build. */
    #cmakedefine CORRECT_SIZE @CORRECT_SIZE@

    #if CORRECT_SIZE >= 20
        [..]
    #endif

Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
@mikkoi mikkoi force-pushed the fix-small-issues-2 branch from 9042980 to 1f7d1c1 Compare September 8, 2019 10:39
Comment thread cmake/check_stdint.h.in Outdated
Will not convert m4/ax_create_stdint_h.m4 to CMake.
Make the resulting check_stdint.h similar to the old one
(as much as is possible).

GNU Autotools build is untouched. It continues to use m4 macro
and generates check_stdint.h from scratch.

Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
@mikkoi mikkoi force-pushed the fix-small-issues-2 branch from 829c9ff to a77491a Compare September 8, 2019 17:51
@brarcher brarcher merged commit 4cd6b30 into libcheck:master Sep 9, 2019
@mikkoi mikkoi deleted the fix-small-issues-2 branch September 9, 2019 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants