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

Compiling on Alpine Linux with musl libc fails due to type conversion error. #13

Closed
Soldering-Stan opened this issue Dec 31, 2020 · 1 comment

Comments

@Soldering-Stan
Copy link

Hi,

compilation fails with the following error messages. I have modified the offending code and it now comiles and works correctly (I've attached diff to bottom of this message), I'm quite happy to make a pull request etc. but don't have full permissions on github to access it. Can somebody grant me permissions etc. or apply the patches if you don't want any old oik access the source :-)

/dev/shm/atomicparsley-master/src/parsley.cpp:5730:26: error: cannot convert 'off_t*' {aka 'long int*'} to 'const fpos_t*' {aka 'const _G_fpos64_t*'}
 5730 |       fsetpos(dest_file, &file_offset);
      |                          ^~~~~~~~~~~~
      |                          |
      |                          off_t* {aka long int*}
In file included from /usr/include/fortify/stdio.h:22,
                 from /dev/shm/atomicparsley-master/src/AtomicParsley.h:50,
                 from /dev/shm/atomicparsley-master/src/AtomDefs.h:23,
                 from /dev/shm/atomicparsley-master/src/parsley.cpp:30:
/usr/include/stdio.h:85:21: note:   initializing argument 2 of 'int fsetpos(FILE*, const fpos_t*)'
   85 | int fsetpos(FILE *, const fpos_t *);
      |                     ^~~~~~~~~~~~~~
/dev/shm/atomicparsley-master/src/parsley.cpp:5745:26: error: cannot convert 'off_t*' {aka 'long int*'} to 'const fpos_t*' {aka 'const _G_fpos64_t*'}
 5745 |       fsetpos(dest_file, &file_offset);
      |                          ^~~~~~~~~~~~
      |                          |
      |                          off_t* {aka long int*}
In file included from /usr/include/fortify/stdio.h:22,
                 from /dev/shm/atomicparsley-master/src/AtomicParsley.h:50,
                 from /dev/shm/atomicparsley-master/src/AtomDefs.h:23,
                 from /dev/shm/atomicparsley-master/src/parsley.cpp:30:
/usr/include/stdio.h:85:21: note:   initializing argument 2 of 'int fsetpos(FILE*, const fpos_t*)'
   85 | int fsetpos(FILE *, const fpos_t *);
      |                     ^~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/AtomicParsley.dir/build.make:187: CMakeFiles/AtomicParsley.dir/src/parsley.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/AtomicParsley.dir/all] Error 2
make: *** [Makefile:104: all] Error 2

Stan's diff below

diff /dev/shm/atomicparsley-master/src/parsley.cpp /usr/local/src/atomicparsley/src/parsley.cpp

5726a5727,5732
> #elif defined(fpos64_t)
>       // Using this it's the only way I can identify musl libc
>       // used on Alpine Linux
> 
>       fpos_t file_offset;
>       file_offset.__lldata = dest_position + file_pos;
5741a5748,5753
> #elif defined(fpos64_t)
>       // Using this because it's the only way I can identify musl libc
>       // used on Alpine Linux
> 
>       fpos_t file_offset;
>       file_offset.__lldata = dest_position + file_pos;
@github-actions
Copy link

Thanks for filing an issue! Please note that this project is only passively maintained, so your best bet for getting an issue resolved is through a pull request that is easy to verify!

@wez wez closed this as completed in cbecfb1 Dec 31, 2020
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

1 participant