title: gcc linking object files with warning/optimization flags
body: <p>We are compiling a piece of software using generics where files are first made into object files, they are built like so:</p>
  <pre><code>arm-unknown-linux-gnu-gcc -c -O2 -Wstrict-prototypes -Wdeclaration-after-statement -fsigned-char -I/opt/tm-sdk/include  -mlittle-endian -Wno-trigraphs -fno-strict-aliasing -fno-omit-frame-pointer -march=armv4 -mtune=arm9tdmi -Wall -Wextra -o src/flex.o src/flex.c
  ...
  arm-unknown-linux-gnu-gcc -c -O2 -Wstrict-prototypes -Wdeclaration-after-statement -fsigned-char -I/opt/tm-sdk/include  -mlittle-endian -Wno-trigraphs -fno-strict-aliasing -fno-omit-frame-pointer -march=armv4 -mtune=arm9tdmi -Wall -Wextra -o src/flexdb.o src/flexdb.c
  </code></pre>
  <p>Then they are linked with:</p>
  <pre><code>arm-unknown-linux-gnu-gcc -o flex src/flex.o src/flexdb.o src/flexio.o src/flexprotocol.o src/flexsettings.o src/flexstate.o -L/opt/tm-sdk/lib -ltag  -lrt -ltmreader -lsqlite3 -lsha1
  </code></pre>
  <p>My questions is:
  Do we need to include optimization and warning flags during linking? Would it do anything if <code>-Wall</code>, <code>-Wextra</code>, and <code>-O2</code> were included when creating the flex binary from the object files?</p>
  <p>Edit: Clarifying meaning based on feedback.</p>