-
Notifications
You must be signed in to change notification settings - Fork 291
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
Portability fixes #297
Portability fixes #297
Conversation
Run |
Indeed, and now it no longer compiles. Please add them back. |
Reviewed 1 of 5 files at r1. .gitignore, line 25 at r1 (raw file):
these aren't make files, they're generated files CMakeLists.txt, line 73 at r1 (raw file):
why did you drop testing/misc_tools.c, line 32 at r1 (raw file):
what are you including strings.h for? testing/tox_sync.c, line 319 at r1 (raw file):
why is this better? Comments from Reviewable |
I know that, but does it really matter? What heading do you want me to put them under?
Because I added -pedantic-errors, which does the same and more.
Because that's where strncasecmp() is declared
Because d_type is a BSD-ism, and the point of this PR is to increase portability. There's a little bit more for me to fix up to get it to build, pls no mergerino por favorino. I'll let you guys know when it's good. |
80fa66f
to
12d2692
Compare
@GrayHatter good now? |
Review status: 1 of 6 files reviewed at latest revision, 7 unresolved discussions. CMakeLists.txt, line 60 at r3 (raw file):
Add the '.' back here and add them to the comments below. CMakeLists.txt, line 68 at r3 (raw file):
Can you add this definition to the files that actually need it rather than the command line? other/bootstrap_daemon/src/log.c, line 119 at r3 (raw file):
This probably doesn't work. Where are the args? Comments from Reviewable |
Review status: 1 of 6 files reviewed at latest revision, 7 unresolved discussions, some commit checks failed. other/bootstrap_daemon/src/log.c, line 119 at r3 (raw file): Previously, iphydf wrote…
Ah. I see now. Don't use Comments from Reviewable |
Review status: 1 of 23 files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. other/bootstrap_daemon/src/log.c, line 119 at r3 (raw file): Previously, iphydf wrote…
The "don't use user-specified format string" is supposed to protect against the format string attacks, isn't it? But all the format strings that we pass to the logging procedure are not really user-specified, they are compile-time specified, the actual user of tox-bootstrapd binary can't alter the format, neither the format string comes from other potentially insecure input sources such as the network. It is user-specified only from the point of the view of the logging module, as in "the rest of the code is the user". Even if we ignore the fact that the string is not really user-specified and for a second assume that it is (it's not though), now we use testing/tox_sync.c, line 319 at r4 (raw file):
So, you allocate a buffer of size X+Y but you write X+Y+1 into it? Comments from Reviewable |
other/bootstrap_daemon/src/log.c, line 119 at r3 (raw file):
use Comments from Reviewable |
@nurupo good catch, i didn't include space for the terminating null. |
@Zer0-One open Reviewable and comment in it. You have to resolve the discussions and such. |
69027f9
to
a0b1dc9
Compare
Resolved Review status: 1 of 25 files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. .gitignore, line 25 at r1 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
We'll clean this up in a different PR, where we shove build artifacts into a directory that isn't the root, and then just keep that untracked by git. CMakeLists.txt, line 73 at r1 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
Because I added -pedantic-errors CMakeLists.txt, line 60 at r3 (raw file): Previously, iphydf wrote…
done CMakeLists.txt, line 68 at r3 (raw file): Previously, iphydf wrote…
done testing/misc_tools.c, line 32 at r1 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
Because that's where strncasecmp() is declared testing/tox_sync.c, line 319 at r1 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
Because d_type is a BSD-ism testing/tox_sync.c, line 319 at r4 (raw file): Previously, nurupo wrote…
good catch Comments from Reviewable |
Review status: 1 of 25 files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. Comments from Reviewable |
@Zer0-One I've pushed a commit. Please squash it into yours if you are ok with that change. |
Review status: 1 of 26 files reviewed at latest revision, 7 unresolved discussions. CMakeLists.txt, line 60 at r3 (raw file): Previously, Zer0-One (David Zero) wrote…
Not really done. Add other/bootstrap_daemon/src/log.c, line 119 at r3 (raw file): Previously, nurupo wrote…
Comments from Reviewable |
52501ae
to
0d12a4b
Compare
rebased onto latest master Review status: 11 of 27 files reviewed at latest revision, 7 unresolved discussions. other/bootstrap_daemon/src/log.c, line 91 at r7 (raw file): Previously, nurupo wrote…
lol whoops. fixed Comments from Reviewable |
Reviewed 2 of 5 files at r1, 4 of 20 files at r4, 3 of 8 files at r5, 10 of 13 files at r7, 6 of 6 files at r8. Comments from Reviewable |
Reviewed 1 of 8 files at r5. Comments from Reviewable |
@nurupo is this done? |
Reviewed 11 of 13 files at r7, 6 of 6 files at r8. other/bootstrap_daemon/src/log.c, line 88 at r8 (raw file):
I just noticed this I think this Comments from Reviewable |
0d12a4b
to
9ed93d8
Compare
finished. rebased onto latest master. Review status: 25 of 27 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. other/bootstrap_daemon/src/log.c, line 88 at r8 (raw file): Previously, nurupo wrote…
you're right, removed. Comments from Reviewable |
Reviewed 1 of 2 files at r9. other/bootstrap_daemon/src/log.c, line 98 at r9 (raw file):
Ok, found another issue. The size you pass to Comments from Reviewable |
Reviewed 1 of 2 files at r9. Comments from Reviewable |
Review status: 26 of 27 files reviewed at latest revision, 3 unresolved discussions. other/bootstrap_daemon/src/log.c, line 119 at r3 (raw file): Previously, iphydf wrote…
@iphydf you need to okay this to clear reviweable other/bootstrap_daemon/src/log.c, line 98 at r9 (raw file): Previously, nurupo wrote…
or init size like then change the if to be Comments from Reviewable |
Reviewed 1 of 2 files at r9. Comments from Reviewable |
Reviewed 3 of 5 files at r1, 4 of 20 files at r4, 4 of 8 files at r5, 10 of 13 files at r7, 4 of 6 files at r8, 2 of 2 files at r9. Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions. other/bootstrap_daemon/src/log.c, line 119 at r3 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
Ack. Comments from Reviewable |
Reviewed 1 of 1 files at r10. Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. other/bootstrap_daemon/src/log.c, line 98 at r9 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
fixed, in what i think is the most readable way. Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions. CMakeLists.txt, line 69 at r10 (raw file):
Indent comments with 2 spaces just like the rest of the block. Comments from Reviewable |
Review status: 26 of 27 files reviewed at latest revision, 2 unresolved discussions. CMakeLists.txt, line 69 at r10 (raw file): Previously, iphydf wrote…
done other/bootstrap_daemon/src/log.c, line 98 at r9 (raw file): Previously, Zer0-One (David Zero) wrote…
Done. Comments from Reviewable |
- CFLAG gnu99 was changed to c99. - CXXFLAG c++98 was changed to c++11. - CFLAG -pedantic-errors was added so that non-ISO C now throws errors. - _XOPEN_SOURCE feature test macro added and set to 600 to expose SUSv3 and c99 definitions in modules that required them. - Fixed tests (and bootstrap daemon logging) that were failing due to the altered build flags. - Avoid string suffix misinterpretation; explicit narrowing conversion. - Misc. additions to .gitignore to make sure build artifacts don't wind up in version control.
Reviewed 1 of 1 files at r10, 2 of 2 files at r11. Comments from Reviewable |
Reviewed 2 of 2 files at r11. Comments from Reviewable |
and c99 definitions in modules that required them.
the altered build flags.
up in version control.
I didn't try running the tests, but everything seems to build just fine now. If someone could test for me, I'd really appreciate it.
This change is