Where does the __1 symbol come from when using LLVM’s libc++?
It is from C++11 inlined namespaces libc++ has something like namespace std { inline namespace __1 { …. more at What are inline namespaces for?
It is from C++11 inlined namespaces libc++ has something like namespace std { inline namespace __1 { …. more at What are inline namespaces for?
The standard requires that, all types used in template components of the standard library must be complete, unless otherwise stated. Thus libc++’s error is correct. Using an incomplete type is undefined behavior (§17.6.4.8[res.on.functions]/2), so libstdc++ accepting it isn’t wrong either. You could use a pointer object to construct the complete type as you did. But … Read more
I am pretty sure you have to see the documentation Edit: How about this list then? From man signal: NOTES The effects of this call in a multi-threaded process are unspecified. The routine handler must be very careful, since processing elsewhere was interrupted at some arbitrary point. POSIX has the concept of “safe function”. If … Read more
dwc is right, IPV6_PKTINFO will work for IPv6 on Linux. Moreover, IP_PKTINFO will work for IPv4 — you can see details in manpage ip(7)
Please see the clarification at the bottom of the answer for the reasoning being used in this answer. Is there any reason that you would not use the getmntent libc library call? I do realize that it’s not the same as an ‘all in one’ system call, but it should allow you to get the … Read more
What you’re seeing is the use of inline namespaces to achieve ABI versioning. What that means: The libstdc++ std::string is a different data structure than the libc++ std::string. The former is a reference counted design, whereas the latter is not. Although they are API compatible, they are not ABI compatible. That means that if you … Read more
I would use the native library for each OS i.e. libstdc++ on GNU/Linux and libc++ on Mac OS X. libc++ is not 100% complete on GNU/Linux, and there’s no real advantage to using it when libstdc++ is more complete. Also, if you want to link to any other libraries written in C++ they will almost … Read more
I found out how to do it: rpath specifies where the provided libraries are located. This folder should contain: libc.so.6, libdl.so.2, libgcc_s.so.1 and maybe more. Check with strace to find out which libraries your binary file uses. ld.so is the provided linker gcc -Xlinker -rpath=/default/path/to/libraries -Xlinker -I/default/path/to/libraries/ld.so program.c
It’s because the rationale is that performance should be optimized for iterators, not indices. (In other words, performance should be optimized for begin()/end(), not size()/operator[].) Why? Because iterators are generalized pointers, and thus C++ encourages their use, and in return ensures that their performance matches those of raw pointers when the two are equivalent. To … Read more
You can use the wrap feature provided by ld. From man ld: –wrap symbol Use a wrapper function for symbol. Any undefined reference to symbol will be resolved to __wrap_symbol. Any undefined reference to __real_symbol will be resolved to symbol. So you just have to use the prefix __wrap_ for your wrapper function and __real_ … Read more