Fix 900+ acceptance tests on Windows #1853

Merged
merged 2 commits into from Jul 18, 2014

Conversation

Projects
None yet
3 participants
Owner

kacf commented Jul 18, 2014

commit e3c783495923f6829b77f7e43fe7e41385f1e6c2
Author: Kristian Amlie 
Date:   Fri Jul 18 14:46:51 2014

    Use %jd and %ju instead of PRIdMAX and PRIuMAX.
    
    The problem is that on Windows PRI[du]MAX expands to a
    Windows-specific printf flag, but we are using printf wrappers, which
    do not understand that flag. The 'j' flag on the other hand, is not
    supported by Windows, but *is* supported by our wrapper, so it's safe
    to use.
    
    One notable exception from in the commit is a scanf which uses
    PRIdMAX. scanf is not covered by our wrappers at the moment, and has
    no replacement, so we need to leave that as it is. sprintf is not
    covered either, but can (and should) be replaced with snprintf.

commit 26b224c7598bd19237fbc1be6844416f50266658
Author: Kristian Amlie 
Date:   Fri Jul 18 14:44:28 2014

    Disable printf format warnings on Windows.
    
    Our wrapper supports more flags than vanilla Windows version, so they
    are false positives.

kacf added some commits Jul 18, 2014

Disable printf format warnings on Windows.
Our wrapper supports more flags than vanilla Windows version, so they
are false positives.
Use %jd and %ju instead of PRIdMAX and PRIuMAX.
The problem is that on Windows PRI[du]MAX expands to a
Windows-specific printf flag, but we are using printf wrappers, which
do not understand that flag. The 'j' flag on the other hand, is not
supported by Windows, but *is* supported by our wrapper, so it's safe
to use.

One notable exception from in the commit is a scanf which uses
PRIdMAX. scanf is not covered by our wrappers at the moment, and has
no replacement, so we need to leave that as it is. sprintf is not
covered either, but can (and should) be replaced with snprintf.
Owner

kacf commented Jul 18, 2014

Contributor

ediosyncratic commented Jul 18, 2014

Obvious hazard: are there any other platforms on which PRI[du]MAX is needed because we're using the native printf-family ?

Owner

kacf commented Jul 18, 2014

Obvious hazard: are there any other platforms on which PRI[du]MAX is needed because we're using the native printf-family ?

No. According to @jimis (correct me if I'm wrong here), all our platforms use wrappers except Linux. And the wrappers support %jd.

Contributor

ediosyncratic commented Jul 18, 2014

OK, good that the obvious hazard is a non-issue.

Testing failed due to memory running out, on RedHat. I'll run with the theory that this is a build-system failure rather than a problem with your change.

ediosyncratic added a commit that referenced this pull request Jul 18, 2014

Merge pull request #1853 from kacfengine/windows
Fix 900+ acceptance tests on Windows

@ediosyncratic ediosyncratic merged commit be8cd4f into cfengine:master Jul 18, 2014

1 check failed

default Merged build finished.
Details
Contributor

jimis commented Jul 18, 2014

On Fri, Jul 18, 2014 at 3:20 PM, Kristian Amlie notifications@github.com
wrote:

Obvious hazard: are there any other platforms on which PRI[du]MAX is
needed because we're using the native printf-family ?

No. According to @jimis https://github.com/jimis (correct me if I'm
wrong here), all our platforms use wrappers except Linux. And the wrappers
support %jd.

Almost: all platforms that are not detected as C99 compatible use our
wrappers. I would assume latest Solaris for example does not need the
wrappers.

But anyway if some platform misbehaves with %jd, we should fix the test to
detect the failure so that the platform uses our wrapper, I've done it
before, I can do it again if I know the exact nature of the failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment