View Single Post
Old 2015-01-03, 16:38   #3
Explorer09
 
May 2014

1000012 Posts
Default

Quote:
Originally Posted by Mark Rose View Post
Perhaps you should provide a patch for that ;)
You mean something like this?

Attachment: prime95-string-const-macro.patch.7z (Don't try to apply this one directly. Review it and apply it by hand instead. Because I'm making this diff on my own tree which have other changes not in original Prime95 source.)

1. I changed those string constants to macros because (1) they won't be compiled in if the message is never referenced, and (2) better leave out this JUNK because there's one copyright string already in menu.c:
Code:
/* In commonc.c */
char JUNK[]="Copyright 1996-2014 Mersenne Research, Inc. All rights reserved"
(Converting it to "const char JUNK[]" will still end up being compiled into the binary.)

There are other changes in this patch:
2. SELF_TEST_DATA arrays (used in torture testing) are now all "const struct self_test_info". These arrays are never supposed to be edited anyway. (Compilers will now put these in ".rodata" section rather than ".data")
3. OutputSomewhere, OutputBoth, OutputStr, OutputStrNoTimeStamp, writeResults, LogMsg, RealOutputStr functions now all take "const char *" string argument.
Attached Files
File Type: 7z prime95-string-const-macro.patch.7z (3.2 KB, 81 views)

Last fiddled with by Explorer09 on 2015-01-03 at 16:41
Explorer09 is offline   Reply With Quote