Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't build #4

Closed
Ivshti opened this issue Jun 22, 2016 · 10 comments
Closed

can't build #4

Ivshti opened this issue Jun 22, 2016 · 10 comments

Comments

@Ivshti
Copy link
Contributor

Ivshti commented Jun 22, 2016

can't seem to build longs, getting this:

Ivo-MacBook-Pro:longs ivogeorgiev$ make 
cc -W -Wall -O2 -Wno-unused-parameter -g -D NOPE_THREADS= -pthread     -c -o waferapi.o waferapi.c
waferapi.c:268:14: error: use of undeclared identifier 'BUFFLEN'
    char buf[BUFFLEN];
             ^
waferapi.c:270:45: error: use of undeclared identifier 'BUFFLEN'
    ssize_t bytes_read = read(read_fd, buf, BUFFLEN);
                                            ^
waferapi.c:271:45: error: use of undeclared identifier 'cbuf'; did you mean 'buf'?
    ssize_t bytes_written = write(write_fd, cbuf, bytes_read);
                                            ^~~~

I grepped everything for BUFFLEN but there's no such thing. Furthermore I googled the errors, again nothing

@rrezel
Copy link
Contributor

rrezel commented Jun 23, 2016

Are you trying to build this on OSX?

@Ivshti
Copy link
Contributor Author

Ivshti commented Jun 23, 2016

yes, is this relevant? sqlite3 is certainly OK on OSX, not sure about wafer

@Ivshti
Copy link
Contributor Author

Ivshti commented Jun 23, 2016

do you know where BUFFLEN comes from?

@rrezel
Copy link
Contributor

rrezel commented Jun 23, 2016

yes, is this relevant?
Yes:
#ifndef __linux__

That part of the code never got tested. It's a bug. We're sorry. We'll fix it.

rrezel added a commit that referenced this issue Jun 24, 2016
@rrezel
Copy link
Contributor

rrezel commented Jun 24, 2016

This should be fixed now. Can you please verify?

@Ivshti
Copy link
Contributor Author

Ivshti commented Jun 24, 2016

hm..seems to be the same after I pulled

7 warnings generated.
cc -W -Wall -O2 -Wno-unused-parameter -g      -pthread -c -o waferapi.o waferapi.c
waferapi.c:268:14: error: use of undeclared identifier 'BUFFLEN'
    char buf[BUFFLEN];
             ^
waferapi.c:270:45: error: use of undeclared identifier 'BUFFLEN'
    ssize_t bytes_read = read(read_fd, buf, BUFFLEN);
                                            ^
waferapi.c:271:45: error: use of undeclared identifier 'cbuf'; did you mean 'buf'?
    ssize_t bytes_written = write(write_fd, cbuf, bytes_read);
                                            ^~~~
                                            buf
waferapi.c:268:10: note: 'buf' declared here
    char buf[BUFFLEN];
         ^

I also tried deleting all .o files and build artifacts

@rrezel
Copy link
Contributor

rrezel commented Jun 24, 2016

I think I didn't push the changes. BUFFLEN shouldn't be there at all. Would you mind trying again? I'm really sorry about this.

@Ivshti
Copy link
Contributor Author

Ivshti commented Jun 24, 2016

Thanks a lot of the help

Now it's that:

waferapi.c:271:45: error: use of undeclared identifier 'cbuf'; did you mean 'buf'?
    ssize_t bytes_written = write(write_fd, cbuf, bytes_read);
                                            ^~~~
                                            buf
waferapi.c:268:10: note: 'buf' declared here
    char buf[MAX_BUFFER_SIZE];
         ^

Should I replace buf with cbuf? Doesn't look that way

@Ivshti
Copy link
Contributor Author

Ivshti commented Jun 24, 2016

Replaced cbuf with buf. Works now

@rrezel
Copy link
Contributor

rrezel commented Jun 24, 2016

Thanks for the PR.

@Ivshti Ivshti closed this as completed Jun 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants