Martchus / cpp-utilities

Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
GNU General Public License v2.0
52 stars 18 forks source link

error: member reference base type 'const char *' is not a structure or union #32

Closed yurivict closed 1 month ago

yurivict commented 3 months ago

Version 5.26.0 fails:

/usr/ports/devel/cpp-utilities/work/cpp-utilities-5.26.0/io/nativefilestream.cpp:199:29: error: member reference base type 'const char *' is not a structure or union
  199 |     descriptor = ::open(path.data(), nativeParams.openFlags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
      |                         ~~~~^~~~~
1 error generated.

clang-18 FreeBSD 14.1

Martchus commented 3 months ago

Maybe a libc++ or configuration specific code. Otherwise I fail to see why this can compile anywhere.

I can have a look later but since you can already reproduce it - feel free to create a PR as the fix is probably very simple (get rid of .data()).

Martchus commented 3 months ago

This should be fixed by https://github.com/Martchus/cpp-utilities/commit/e79fcf793e4ff3ab90ec870496349725cd9b76dd but I haven't had the time to test it yet.

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Martchus commented 1 month ago

My Android builds (which also use this configuration) work so I guess this can be closed.