Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am jonm on github.
  • I am jon_moore (https://keybase.io/jon_moore) on keybase.
  • I have a public key whose fingerprint is F768 1F51 860C A81F 987B 1178 A2C7 49E7 BB6B 22C4

To claim this, I am signing this object:

@jonm
jonm / initial-compilation-errors.txt
Last active Oct 3, 2015
initial compilation errors
View initial-compilation-errors.txt
$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o comm.o comm.c
In file included from comm.c:21:
./protos.h:21:7: error: conflicting types for 'strdup'
char *strdup(char *source);
^
/usr/include/string.h:117:7: note: previous declaration is here
char *strdup(const char *);
^
comm.c:133:7: warning: implicitly declaring library function 'log' with type
@jonm
jonm / compiler-version.txt
Last active Oct 3, 2015
compiler version
View compiler-version.txt
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
@jonm
jonm / strdup-decl.txt
Created Oct 3, 2015
Error describing a duplicated/conflicting declaration.
View strdup-decl.txt
$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o comm.o comm.c
In file included from comm.c:21:
./protos.h:21:7: error: conflicting types for 'strdup'
char *strdup(char *source);
^
/usr/include/string.h:117:7: note: previous declaration is here
char *strdup(const char *);
...
@jonm
jonm / -Wreturn-type.txt
Created Oct 3, 2015
control reaches end of non-void function
View -Wreturn-type.txt
$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o comm.o comm.c
comm.c:98:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
...
@jonm
jonm / comm-c-Wreturn-type.c
Last active Oct 4, 2015
the `close_socket_fd` function
View comm-c-Wreturn-type.c
int close_socket_fd( int desc)
{
struct descriptor_data *d;
extern struct descriptor_data *descriptor_list;
for (d = descriptor_list;d;d=d->next) {
if (d->descriptor == desc) {
close_socket(d);
}
}
@jonm
jonm / overridden-log-error.txt
Created Oct 3, 2015
Compilation error with the `log()` function.
View overridden-log-error.txt
$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o comm.o comm.c
comm.c:133:7: warning: implicitly declaring library function 'log' with type
'double (double)'
log("Lawful mode selected.");
^
comm.c:133:7: note: please include the header <math.h> or explicitly provide a
declaration for 'log'
...
@jonm
jonm / missing-proto-log_msg.txt
Created Oct 3, 2015
the log_msg() function is missing a prototype
View missing-proto-log_msg.txt
$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o comm.o comm.c
comm.c:133:7: warning: implicit declaration of function 'log_msg' is invalid in
C99 [-Wimplicit-function-declaration]
log_msg("Lawful mode selected.");
^
...
@jonm
jonm / bind-arg-mismatch.txt
Created Oct 3, 2015
we are calling bind() with the wrong number of arguments
View bind-arg-mismatch.txt
$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o comm.o comm.c
...
comm.c:747:31: error: too many arguments to function call, expected 3, have 4
if (bind(s, &sa, sizeof(sa), 0) < 0) {
~~~~ ^
/usr/include/sys/socket.h:557:1: note: 'bind' declared here
int bind(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS(bind);
^
...
@jonm
jonm / ifdef-zero.txt
Created Oct 3, 2015
ifdef 0 is outdated, apparently
View ifdef-zero.txt
$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o comm.o comm.c
...
comm.c:771:8: error: macro names must be identifiers
#ifdef 0
^
...