title: How to use REAL function once it is declared as WEAK function in C?
body: <p>I have a problem when using WEAK reference in C. Make assumption, I have the src code structure as follows: </p>
  
  <p>//Eclipse C project structure</p>
  
  <pre><code>    drv
       |   dummy      
       |     |  dummy_Test.h
       |     |  dummy_TestWeakAttribute.h
       |   src
       |     |  source_sample.c
       |   test
       |     |  myModules
       |             strong_test_case.c
       |             weak_test_case.c
      test_program.c
  </code></pre>
  
  <p>And:</p>
  
  <p>//test_program.c</p>
  
  <pre><code>#include "drv/dummy/dummy_TestWeakAttribute.h"
  #include "drv/dummy/dummy_Test.h"
  
  int main() {
      printf("===================\n");
      printf("  Welcome to main  \n");
      printf("===================\n");
                              // Expectation
      test();                 //--&gt;real function
      function();             //--&gt;real function
      test_function_strong(); //--&gt;real function
      test_function_weak();   //--&gt;weak function
  
      return 0;
  }
  </code></pre>
  
  <p>//source_sample.c</p>
  
  <pre><code>#include "../dummy/dummy_TestWeakAttribute.h"
  #include "../dummy/dummy_Test.h"
  
  static void test(void) {
      printf("NOT overridden!\n");
  }
  
  static void function(void){
  
      int a =1;
      a++;
      test();
  }
  </code></pre>
  
  <p>//dummy_Test.h</p>
  
  <pre><code>#ifndef DRV_DUMMY_DUMMY_TEST_H_
  #define DRV_DUMMY_DUMMY_TEST_H_
  
  #define static
  //definitions
  
  //struct definitions
  
  //dummy functions
  
  static void test(void);
  static void function(void);
  
  //global variable definitions
  
  #endif /* DRV_DUMMY_DUMMY_TEST_H_ */
  </code></pre>
  
  <p>//dummy_TestWeakAttribute.h</p>
  
  <pre><code>#define static //disable static keyword
  
  static void __attribute__((weak)) test(void);
  </code></pre>
  
  <p>//weak_test_case.c</p>
  
  <pre><code>#include "../../dummy/dummy_TestWeakAttribute.h"
  #include "../../dummy/dummy_Test.h"
  
  static void test(void){
      printf("overridden successfully!\n");
  }
  
  void test_function_weak(void){
      function();
  }
  </code></pre>
  
  <p>//strong_test_case.c</p>
  
  <pre><code>#include "../../dummy/dummy_Test.h"
  
  void test_function_strong(void){
      function();
  }
  </code></pre>
  
  <p>I got the result on the screen:</p>
  
  <pre><code>===================
    Welcome to main  
  ===================
  overridden successfully!
  overridden successfully!
  overridden successfully!
  overridden successfully!
  </code></pre>
  
  <p>I can't use the REAL function anymore. All my making calls to the real <code>test</code> function is impossible because it was declared as <code>__attribute__((weak))</code> before. So, Is there anybody having idea on this case ? The main purpose, I'd like to call my real <code>test</code> (in <code>source_sample.c</code>) but <strong>don't remove</strong> <code>weak</code> attribute as well.</p>