johnpneumann / Fortune-OSX

Just use homebrew. -- Archived -- Fortune done right on OSX. Fixes issues from ThinkyHead Softwares port of it not recognizing fortune <file> or fortune -f
6 stars 3 forks source link

Problem finding the definition of function 're_comp' #1

Open JolleyLama opened 8 years ago

JolleyLama commented 8 years ago

When compiling on El Capitan, I get a series of error messages starting with this:

cc -m32 -Os -pipe  -o work/fortune fortune.c regexpr.o
fortune.c:399:16: warning: implicit declaration of function 're_comp' is invalid
      in C99 [-Wimplicit-function-declaration]
                if (BAD_COMP(RE_COMP(pat))) {
                             ^

I fixed this by adding this to fortune.c:

# include "regexpr.h"

Right after the include section at the top of the file. I added it right after # include "pathnames.h". I'm not much of a C developer either, but I saw that 're_comp' was defined in that header file, and the header file wasn't being included anywhere.

JolleyLama commented 8 years ago

I don't know how active this repository is, so I'm really posting this to help others get this to build.

johnpneumann commented 8 years ago

@JolleyLama - Thanks for the report. I monitor the repo, but it's seen little to no activity so have not needed to do much. If you want to submit a PR, feel free and I'll merge it in. That being said, on OSX, I've found it much easier to just use homebrew to install fortune (since I utilize it to manage more packages than just fortune). I can understand that others may not want to install homebrew (I'm not sure why, but I'm sure that folks have their reasons), so I'd be happy to take a PR to fix this in case it might help someone else.