[vox-tech] Permission Denied Error
Bill Kendrick
nbs at sonic.net
Fri Jul 9 10:59:42 PDT 2010
On Thu, Jul 08, 2010 at 10:19:00PM -0700, Jeff Newmiller wrote:
> Unless you have the full source code and are familiar enough with it
> to insure that it doesn't have hidden dependencies on those constants,
> and are recompiling the full source code, you should still be wary of
> changing read-only headers.
Indeed.
Furthermore, a more proper way of altering constants for your own
app's purpose would be to redefine them in your source, rather than
alter the library's header file.
e.g.:
#include <some_library_header.h>
#if defined(SOMECONST)
#undef SOMECONST
#end
/* Override some_library_header.h's SOMECONST with my own number */
#define SOMECONST 1234
Obviously, this changed constant will only be visible to the file(s)
that see the above C preprocessor commands.
But do keep in mind, as explained earlier, even if you change some
#define's _in the system-wide header file_ (e.g., if I go in and
screw around with "/usr/include/stdio.h"), those changes will only
affect:
* programs compiled with that header
* and compiled AFTER I edited it
The "stdio" library itself, and any applications which were compiled
against the "stdio.h" header prior to my edits, will REMAIN UNCHANGED.
I'm throwing these caveats in here because I think we still don't
know exactly what you're trying to accomplish. :) Based on the vague
requirement of "need to change numbers in a header file", what you're
trying to do could range from trivial to impossible to downright
dangerous. :)
-bill!
More information about the vox-tech
mailing list