Hi,

I installed:
   workflow-plugin 1.12
   warnings plugin 4.51
    jenkins 1.641

I used the workflow snipper generator to generate code to
 invoke the warnings plugin.

I came up with the following example:

node {
    writeFile(file: "a.c", text: '''
#include <sys/types.h>
#include <stdlib.h>

void
func1(void)
{
}

int
main(int argc, char *argv[])
{
    char *a;
    int64_t *b;
    b = (int64_t *)a;
    printf("Hi");
    printf(NULL);
    printf("%s %d\\n", "35");
    func1();
}
'''
    )
    sh "cc -Wall -W -Wcast-align -o output a.c"

    step([$class: 'WarningsPublisher',
         canComputeNew: false,
         canResolveRelativePaths: false,
         consoleParsers: [[parserName: 'Clang (LLVM based)']],
         defaultEncoding: '',
         excludePattern: '',
         healthy: '',
         includePattern: '',
         messagesPattern: '',
         unHealthy: ''])
}

This code example triggers warnings with the clang compiler,
which I can see in the log, but the warnings plugin is reporting 0 warnings.

Any ideas how I can fix this?
Thanks.
--
Craig

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAG%3DrPVcAvHh-SBw0xsNVUc7Q7XkBRM%2B-LDF6jveL_PgJJ5k%2BqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Started by user anonymous
[Workflow] Allocate node : Start
Running on master in /usr/local/jenkins/jobs/blah2/workspace
[Workflow] node {
[Workflow] writeFile
[Workflow] sh
[workspace] Running shell script
+ cc -Wall -W -Wcast-align -o output a.c
a.c:15:9: warning: cast from 'char *' to 'int64_t *' (aka 'long *') increases 
required alignment from 1 to 8 [-Wcast-align]
    b = (int64_t *)a;
        ^~~~~~~~~~~~
a.c:16:5: warning: implicitly declaring library function 'printf' with type 
'int (const char *, ...)'
    printf("Hi");
    ^
a.c:16:5: note: include the header <stdio.h> or explicitly provide a 
declaration for 'printf'
a.c:18:17: warning: more '%' conversions than data arguments [-Wformat]
    printf("%s %d\n", "35");
               ~^
a.c:11:10: warning: unused parameter 'argc' [-Wunused-parameter]
main(int argc, char *argv[])
         ^
a.c:11:22: warning: unused parameter 'argv' [-Wunused-parameter]
main(int argc, char *argv[])
                     ^
a.c:15:20: warning: variable 'a' is uninitialized when used here 
[-Wuninitialized]
    b = (int64_t *)a;
                   ^
a.c:13:12: note: initialize the variable 'a' to silence this warning
    char *a;
           ^
            = NULL
6 warnings generated.
[Workflow] step
[WARNINGS] Parsing warnings in console log with parser Clang (LLVM based)
[WARNINGS] Computing warning deltas based on reference build #33
[Workflow] } //node
[Workflow] Allocate node : End
[Workflow] End of Workflow
Finished: SUCCESS
Success Build #34 (Dec 22, 2015 6:09:18 AM)
add description
        

Started by anonymous user
        LLVM/Clang Warnings: 0 warnings.

    No warnings since build 24.
    New zero warnings highscore: no warnings since yesterday!

Reply via email to