generated from bazel-contrib/rules-template
-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add C example and file extension. (#349)
* Add C example and file extension. * First class support for C formatting. * Update starlark docs.
- Loading branch information
1 parent
5d056cb
commit 7ef5063
Showing
6 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
// deliberately bad code to trigger clang-tidy warning | ||
int string_to_int(const char *num) { return atoi(num); } | ||
|
||
// deliberately insecure code to trigger clang-tidy warning | ||
void ls() { system("ls"); } | ||
|
||
static int compare(int x, int y) { | ||
if (x < y) | ||
; | ||
{ x++; } | ||
return x; | ||
} | ||
|
||
int main() { | ||
printf("Hello, world!\n"); | ||
compare(3, 4); | ||
char *a = NULL; | ||
char *b = 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters