<commit_before>.Dd November 22 2017
.Dt CFU 1
.nh
.Os
.Sh NAME
.Nm cfu
.Nd compiles and runs C code
.Sh SYNOPSIS
.Bk -words
.Nm
.Op Fl b Ar bits
.Op Fl E Ar exeargs
.Op Fl F Ar name
.Op Fl g Ar globals
.Op Cm --preserve
.Op Cm --show-code
.Ar c-statements|-
.Ek
.Sh DESCRIPTION
.Nm
compiles and runs C code via temporary files. The code will be taken
from the command line arguments, or from standard input if the only
argument is a hyphen.
Options:
.Bl -tag -width Ds
.It Cm --bits= Ns bits Op Fl b Ar bits
Compile with the given number of bits, usually 32 or 64.
.It Cm --eargs= Ns exeargs Op Fl E Ar exeargs
Arguments to pass to the compiled executable. May be specified more than
once to pass multiple arguments.
.It Cm --fakname= Ns name Op Fl F Ar name
Use
.Ar name
as the application name executed instead of
.Nm .
.It Cm --globals= Ns globals Op Fl g Ar globals
Globals for the C source code (defines, global variables, includes,
functions). Many includes are set by default. May be specified more than
once to pass multiple arguments.
.It Cm --preserve Op Fl P
Do not unlink the temporary source and executable files at exit. The
paths to these files will be printed to standard output.
.It Cm --show-code Op Fl l
Shows the code that would be compiled, then exits.
.El
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Cm CC
Sets the name of the compiler to use,
.Pa cc
by default.
.It Cm CFLAGS
Arguments for the compiler. These will be shell word split. Flags are
set by default; see the source code for details. Some
.Cm CFLAGS
may be set by other command line options.
.El
.Sh EXIT STATUS
.Ex -std
.Nm
tries to pass along the exit status of the compiler, and replaces itself
with the compiled program if all goes well.
.Sh EXAMPLES
No trailing semicolon is required on individual arguments.
.Pp
.Dl $ Ic cfu 'puts("hi")' 'puts("there")'
.Pp
But is between multiple statements in a single argument.
.Pp
.Dl $ Ic cfu 'double x=0/0.; char *c=(char *)&x; c[2]=7; printf("%g\en",x)'
.Pp
A more complicated example that sets a define and passes an argument to
the executable.
.Pp
.Dl $ Ic cfu -g '#define X 10' -E arg 'printf("%s %d\en", *++argv, X)'
.Pp
The program name can be customized, if necessary.
.Pp
.Dl $ Ic cfu 'printf("%s\en", *argv)'
.Dl cfu
.Dl $ Ic cfu -F foo 'printf("%s\en", *argv)'
.Dl foo
.Pp
Bits can be used for example to compile a 32- or 64-bit program, assuming
the system supports that.
.Pp
.Dl $ Ic cfu 'printf("%ld\en", sizeof(long))'
.Dl 8
.Dl $ Ic cfu -b 32 'printf("%ld\en", sizeof(long))'
.Dl 4
.Pp
.Sh AUTHOR
.An <NAME><commit_msg>16777216 (or 16777217) is an interesting number given the right context<commit_after>.Dd November 24 2017
.Dt CFU 1
.nh
.Os
.Sh NAME
.Nm cfu
.Nd compiles and runs C code
.Sh SYNOPSIS
.Bk -words
.Nm
.Op Fl b Ar bits
.Op Fl E Ar exeargs
.Op Fl F Ar name
.Op Fl g Ar globals
.Op Cm --preserve
.Op Cm --show-code
.Ar c-statements|-
.Ek
.Sh DESCRIPTION
.Nm
compiles and runs C code via temporary files. The code will be taken
from the command line arguments, or from standard input if the only
argument is a hyphen.
Options:
.Bl -tag -width Ds
.It Cm --bits= Ns bits Op Fl b Ar bits
Compile with the given number of bits, usually 32 or 64.
.It Cm --eargs= Ns exeargs Op Fl E Ar exeargs
Arguments to pass to the compiled executable. May be specified more than
once to pass multiple arguments.
.It Cm --fakname= Ns name Op Fl F Ar name
Use
.Ar name
as the application name executed instead of
.Nm .
.It Cm --globals= Ns globals Op Fl g Ar globals
Globals for the C source code (defines, global variables, includes,
functions). Many includes are set by default. May be specified more than
once to pass multiple arguments.
.It Cm --preserve Op Fl P
Do not unlink the temporary source and executable files at exit. The
paths to these files will be printed to standard output.
.It Cm --show-code Op Fl l
Shows the code that would be compiled, then exits.
.El
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Cm CC
Sets the name of the compiler to use,
.Pa cc
by default.
.It Cm CFLAGS
Arguments for the compiler. These will be shell word split. Flags are
set by default; see the source code for details. Some
.Cm CFLAGS
may be set by other command line options.
.El
.Sh EXIT STATUS
.Ex -std
.Nm
tries to pass along the exit status of the compiler, and replaces itself
with the compiled program if all goes well.
.Sh EXAMPLES
No trailing semicolon is required on individual arguments.
.Pp
.Dl $ Ic cfu 'puts("hi")' 'puts("there")'
.Pp
But is between multiple statements in a single argument.
.Pp
.Dl $ Ic cfu 'double x=0/0.; char *c=(char *)&x; c[2]=7; printf("%g\en",x)'
.Pp
A more complicated example that sets a define and passes an argument to
the executable.
.Pp
.Dl $ Ic cfu -g '#define X 10' -E arg 'printf("%s %d\en", *++argv, X)'
.Pp
The program name can be customized, if necessary.
.Pp
.Dl $ Ic cfu 'printf("%s\en", *argv)'
.Dl cfu
.Dl $ Ic cfu -F foo 'printf("%s\en", *argv)'
.Dl foo
.Pp
Bits can be used for example to compile a 32- or 64-bit program, assuming
the system supports that.
.Pp
.Dl $ Ic cfu 'printf("%ld\en", sizeof(long))'
.Dl 8
.Dl $ Ic cfu -b 32 'printf("%ld\en", sizeof(long))'
.Dl 4
.Pp
Math is hard.
.Pp
.Dl $ Ic cfu 'float x=16777216;float y=16777217;printf(\&"%.f %.f\en\&",x,y)'
.Dl 16777216 16777216
.Pp
.Sh AUTHOR
.An <NAME>
{'fraction_non_alphanumeric': 0.09796149490373726, 'fraction_numerical': 0.01849754624386561, 'mean_word_length': 3.33988533988534, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6216647', 'n_tokens_mistral': 1957, 'n_tokens_neox': 1857, 'n_words': 940}