Home Download Buy Blog Forum Support

Help with build system for C-lang

Help with build system for C-lang

Postby benregn on Thu Jul 12, 2012 10:07 am

So I made a build system for C and this is what I got so far:

Code: Select all
    {
        "cmd": ["make $file_base_name && ./$file_base_name"],
        "file_regex": "^$file_name(.|\s)*",
        "selector": "source.c",
        "path": "/usr/bin:/usr/local/bin:$file_path",
        "shell": true
    }


What I want shown is:
* Errors/warnings when there are any.
* printf and other print statements when there are any. (Currently this is not shown)

When I build using my custom C.sublime-build, I only get output from the shell when there are errors/warnings. This is a result of my regex, `^$file_name(.|\s)*`. If I comment out the file_regex line, the printf statements are shown but not the errors/warnings. The program output can, of course, be anything.

Sample error output:

Code: Select all
    ex6.c: In function ‘int main(int, char**)’:
    ex6.c:19: warning: format ‘%s’ expects type ‘char*’, but argument 2 has type ‘int’
    ex6.c:19: warning: format ‘%c’ expects type ‘int’, but argument 3 has type ‘char*’
    ex6.c:19: warning: format ‘%s’ expects type ‘char*’, but argument 2 has type ‘int’
    ex6.c:19: warning: format ‘%c’ expects type ‘int’, but argument 3 has type ‘char*’
benregn
 
Posts: 1
Joined: Thu Jul 12, 2012 9:58 am

Return to Technical Support

Who is online

Users browsing this forum: estmatic, Exabot [Bot] and 35 guests