1

So, I am using a library for reading serial data. I have the source code of the library and it shows that the size of the serial data is something like this:

SOMETYPE ScopeArray[SCOPE_SIZE];

Where SCOPE_SIZE is defined by a user-defined compiler flag at compile time. Now my question is: If I'm using the library and not the source code, can I change the value of SCOPE_SIZE by recompiling my application not the library?

If this question doesn't make sense please let me know and I'll try my best to re-explain. Thanks!

Fernando Garibaldi
  • 895
  • 1
  • 7
  • 8

2 Answers2

1

A compiled file is data, with a certain, fixed format. If you know the format of the compiled files, you can change them, but this can be difficult and error-prone, and doesn't really have much to do with C. It is not something that you can do by editing the C source code.

Thomas Padron-McCarthy
  • 27,232
  • 8
  • 51
  • 75
0

The answer is no.

During preprocessing (before compilation, when the object file or library created) every macros are processed and it is not possible to modify them anymore.

There is a great thread under this question about the compilation and linking process: How does the compilation/linking process work?

0x6261627564
  • 134
  • 1
  • 4