Comments (2)
Thinking about this a bit more, I'm confused. I view "-D_POSIX_C_SOURCE
" as saying "I need to use POSIX features, not just standard C features". But it seems that some people view "-D_POSIX_C_SOURCE
" as saying "I promise that I'm not using anything other than POSIX"?
One point towards the "I promise I'm not using anything other than POSIX" is this:
When an application includes a header described by POSIX.1-2008, and when this feature test macro is defined to have the value 200809L:
...
Additional symbols not required or explicitly permitted by POSIX.1-2008 to be in that header shall not be made visible, except when enabled by another feature test macro.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_01_01
However, sys/mount.h
isn't in POSIX, nor is statfs
, so I guess this part of the spec doesn't apply?
I notice that I am confused.
from tarsnap.
So, _POSIX_C_SOURCE
says "I claim that this code is strictly POSIX-compliant; make sure that you don't break it". In many cases this means "don't expose symbols which POSIX doesn't mention", since if (for example) an OS declares a function foobar
but the strictly-POSIX-compliant program provides its own foobar
, the incompatible declarations could break the build otherwise.
This does not apply in the case of headers which don't exist in POSIX, because if a program is trying to include those then it's lying about being strictly POSIX-compliant and so all guarantees are voided.
One possibility here would be to put #undef _POSIX_C_SOURCE
at the top of the C files where we're using non-POSIX functionality; I'd hope that there aren't very many such files, but I'm not sure. Alternatively, compile libcperciva code with _POSIX_C_SOURCE set but omit it for libarchive-derived code?
from tarsnap.
Related Issues (20)
- lseek (_llseek) issue introduced in 1f56dc7c35b, possibly only on Linux i686 HOT 11
- Workaround for Windows Subsystem for Linux bug with link() HOT 1
- Add support for .gitignore files HOT 2
- escaping bug/typo in tarsnap(1) manpage HOT 1
- Machine name doesn't work with accents ? HOT 5
- master fails to build on old gcc (below version 9) HOT 9
- apt-key is deprecated - update installation instructions HOT 5
- Tarsnap Website Screen Reader Compatibility HOT 3
- Look for tarsnap.conf in ~/.config/tarsnap/ HOT 1
- Optional support for CACHEDIR.TAG files HOT 2
- New release? HOT 2
- Build fails on NetBSD HOT 4
- build: The <sys/sysctl.h> header is deprecated
- False warnings from clang-scan
- tarsnap can be tricked into skipping file using "touch -r" HOT 5
- libressl 3.6 will add `OPENSSL_cleanup()` HOT 1
- Deleting of archives taking up a lot of server -> client bandwidth HOT 6
- workaround for libc/kernel disagreement about whether lchmod exists HOT 1
- --include option HOT 12
- Anchored excludes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tarsnap.