-
Notifications
You must be signed in to change notification settings - Fork 715
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
Include files parsed incorrectly? #886
Comments
Try:
|
What's the point of trying something that was there before, and did not work (aka caused compiler warnings)? (Since on my machines WIN32 is never defined, the effective code was exactly as you suggested - and it was causing those compiler warnings that report of mis-compilation.) And it doesn't address the lack of Also, when the manuals contradict the observed behavior, I tend to follow the behavior and avoid problems - IMHO better to be with the working code than to be right with broken code. ;-) |
What are you suggesting? That we make a change for you that may cause problems for others? I would ask why is pkcs11-tool.c the only place
|
I'm suggesting silencing compiler warnings that could lead to mis-compiled code, potentially maybe even exploitable, who knows.
Should I matter less than somebody else - one of those mysterious "others"? And yes, you should make a change that improves compile-ability of the code, and reduces issues with it (such as compiler assuming a wrong return type for a function). Even if this change is "for me".
OK, makes sense.
OK, makes sense.
I would ask why it's there in the first place, because it appears to screw the includes on the current compilers. Oh, and this is what the relevant part of
Clang compiler on Mac OS (both clang-3.9 from Macports, and clang from Xcode-8.0.0) reports
And this is the proposed change that accommodates your recommendations (and silences compiler warnings):
|
Using You and Frank should work this out and if |
I'd say that my (proposed) patch is correct. It only lacks Since @frankmorgner added that |
looks like the nftw routine requires There are warning about using nftw. Others have found that Mac OS requires 600 and other packages try not to use it if at all possible: http:https://stackoverflow.com/questions/5378778/what-does-d-xopen-source-do-mean https://bugs.python.org/issue17120 https://caml.inria.fr/mantis/view.php?id=7256 https://gitlab.labs.nic.cz/kslany/libisds/commit/9343ebfc1447952a6c0c601f99147ef969cdddeb The last one above defines a test in configure.ac to see if it should be 500 or 600. @mouse07410 can you try |
I was commenting on your first patch. The second looks better, but still not correct. It may work in your environment. The On Ubuntu 16.4, stdio.h includes features.h a 394 line file that just looks at all these XOPEN, ISO, ANSI and POSIX options. features.h is include by many other header files. Your second patch would include stdio.h which the includes feature.h that sets _FEATURE_H so feature.h in only run once to test all the options. Placingit before I would suspect that string.h would then get included if the above was fixed. Also look at the Mac OS man page for nftw and see if has some special requirements. nftw on linux required the @frankmorgner This problem was caused by your commit. How would you fix it? |
@dengert, I see your point - but the references you mentioned are pretty old (he first one is from 2011). As far as I know, MacOS does not need Also, it looks like the OpenSC build process somehow suppresses compiler-defined flags. I know for a fact that all the compilers on MacOS (both from Xcode, and Macports-installed) define This is the beginning of
And this is the compilation output, proving that the compiler does not have
When I comment out that define:
the compilation does not produce any warning:
I wrote a small test-program that contains
Here's the output:
Perhaps it would be better if @frankmorgner could remove |
Update Here's the define that seems to work (though I'd still prefer not to have
(As you can see, I like to have it explicit what And here's the output:
|
./configure --disable-silent-rules will cause the old full command line to be listed. See:
To see what the preprocessor does I have a very old script file make.cpp: The -E option tells the compile to save the output of the preprocessor in the object file: |
Thank you! Here are the flags by both compilers: It is interesting that I noticed another define that might be useful: Anyways, thanks - your script is very useful. And I wasn't aware of Update
So must be some problem with the build that somehow suppresses these flags. Again, it doesn't matter all that much now. |
http:https://stackoverflow.com/questions/32803754/what-is-the-darwin-c-level-c-preprocessor-symbol
Douglas E. Engert [email protected] |
@frankmorgner @dengert what's the status of this issue? If the proposed patch is acceptable - when are you planning to merge it? If it's not acceptable - what's the problem with it? |
It's unfortunate that Apple doesn't use the correct API definitions. Since everyone is using newer versions by default, I suggest to simply remove |
The above sounds reasonable. |
|
Thank you! What about adding |
@frankmorgner let me ask again: please add
Also, Apple does not need |
@frankmorgner how much time do you need to figure that it's a good idea to include a .h file that defines a function used in the code?
|
Mac OS X 10.11.6, Xcode-8.0, Macports-installed OpenSSL-1.0.2j, current master OpenSC.
File
src/tools/pkcs15-tool.c
is missing<string.h>
include, and include file<stdio.h>
is not included correctly - as evidenced in the compiler output:This patch (placing both includes before "config.h" and XOPEN_SOURCE definition) cures these warnings:
The text was updated successfully, but these errors were encountered: