memset needs cstring and sprintf needs cstdio
Fix build with gcc 4.7 #1126
pull drizzt wants to merge 1 commits into bitcoin:master from drizzt:master changing 2 files +2 −0-
drizzt commented at 11:56 PM on April 19, 2012: contributor
-
luke-jr commented at 12:02 AM on April 20, 2012: member
Is there a reason to use these instead of the standard string.h (memset) and stdio.h (sprintf)?
-
jgarzik commented at 12:49 AM on April 20, 2012: contributor
I admit I'm unclear on the advantages of cstring/cstdio over the normal header.
The bitcoin codebase does currently prefer the C variant ("#include <stdio.h>").
-
laanwj commented at 5:30 AM on April 20, 2012: member
cstdio and such are more canonical c++.
The actual difference is that stdio.h puts the symbols in the global namespace and cstdio puts them in
std(http://stackoverflow.com/questions/7596406/stdio-h-not-standard-in-c).All in all, it doesn't make much difference. But we should not mix them.
-
drizzt commented at 10:48 AM on April 20, 2012: contributor
ok, I'll change my pull request
-
Add missing includes. (Fix bulding under GCC 4.7) 9553c35d89
-
luke-jr commented at 3:35 PM on April 20, 2012: member
Does this actually fix the GCC 4.7 build (without -fpermissive)?
-
drizzt commented at 4:21 PM on April 20, 2012: contributor
Yes. A log is better than 1000 words: http://paste.pocoo.org/show/584719/
-
sipa commented at 9:07 PM on April 21, 2012: member
ACK
-
jgarzik commented at 10:12 PM on April 21, 2012: contributor
ACK
- sipa referenced this in commit 6a7a42be16 on Apr 21, 2012
- sipa merged this on Apr 21, 2012
- sipa closed this on Apr 21, 2012
- coblee referenced this in commit e02f161f44 on Jul 17, 2012
- suprnurd referenced this in commit a4dfcae8f9 on Dec 5, 2017
- lateminer referenced this in commit 3abaeeb5b0 on Jan 22, 2019
- lateminer referenced this in commit c910490c53 on Dec 25, 2019
- DrahtBot locked this on Sep 8, 2021