Thread: A shared function is returning 2 different results for the same input

  1. #1
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733

    A shared function is returning 2 different results for the same input

    I'll start with the link to my code:

    Files * b2410d607f591fc40124f1f6075251ede82190bb * Lee Shallis / Dragonbuilder * GitLab

    And here's the offending function (in src/extra/viewfx/vfxdef.c):
    Code:
    VFXDEF	_vfxdefs[VFXTYPE_COUNT] = {{0}};
    
    VFXDEF const * SeekVfxDef( VFXTYPE type ) { return &_vfxdefs[type]; }
    I don't know about you lot but I can see no reason for this to ever given different addresses (the input in this case was VFXTYPE_UINT), I'm assuming it's a linkage issue but I just don't see where or how, for now here's the relevant information I can think of:

    * makefile goals are in gnu.mak
    * the test app links 2 libraries by default (libbasic*.so & libextra*.so)
    * libextra*.so rely on custom libraries that link back to it & libbasic*.so
    * the only custom libraries in use right now are libvfxgl*.so & libvfxglfw*.so (I'm sure you can guess for what purpose they hold)

    That's all I can think of, any help is appreciated

  2. #2
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,110
    Have you actually tried to compile your entire project under Linux using gcc???

    Are you not receiving error and warning messages however you are compiling the project?

    Run "make clean", if you have it defined, otherwise, DEFINE IT, then start here:
    Code:
    other@XYZ:~/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb$ make
    ext_pfx=.clang
    include gnu.mak
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/agedby.c.clang.o -c src/basic/agedby.c
    In file included from include/basic/shared.h:5,
                     from include/basic/agedby.h:5,
                     from src/basic/agedby.c:1:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/branch.c.clang.o -c src/basic/branch.c
    In file included from include/basic/shared.h:5,
                     from include/basic/branch.h:4,
                     from include/basic/_/_branch.h:3,
                     from src/basic/branch.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/buffer.c.clang.o -c src/basic/buffer.c
    In file included from include/basic/shared.h:5,
                     from include/basic/buffer.h:4,
                     from include/basic/_/_buffer.h:3,
                     from src/basic/buffer.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/defect.c.clang.o -c src/basic/defect.c
    In file included from src/basic/defect.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/encode.c.clang.o -c src/basic/encode.c
    In file included from include/basic/shared.h:5,
                     from include/basic/buffer.h:4,
                     from include/basic/encode.h:3,
                     from src/basic/encode.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/moment.c.clang.o -c src/basic/moment.c
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/pipefd.c.clang.o -c src/basic/pipefd.c
    In file included from include/basic/pipeio.h:4,
                     from src/basic/pipefd.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/shared.c.clang.o -c src/basic/shared.c
    In file included from include/basic/shared.h:5,
                     from src/basic/shared.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/thread.c.clang.o -c src/basic/thread.c
    In file included from include/basic/thread.h:4,
                     from src/basic/thread.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/buffer/dints.c.clang.o -c src/basic/buffer/dints.c
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/buffer/voids.c.clang.o -c src/basic/buffer/voids.c
    In file included from include/basic/shared.h:5,
                     from include/basic/buffer/voids.h:4,
                     from src/basic/buffer/voids.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/string/achs.c.clang.o -c src/basic/string/achs.c
    In file included from include/basic/shared.h:5,
                     from include/basic/buffer.h:4,
                     from include/basic/_/_buffer.h:3,
                     from include/basic/_/_string.h:3,
                     from src/basic/string/achs.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/string/c16s.c.clang.o -c src/basic/string/c16s.c
    In file included from include/basic/shared.h:5,
                     from include/basic/buffer.h:4,
                     from include/basic/_/_buffer.h:3,
                     from include/basic/_/_string.h:3,
                     from src/basic/string/c16s.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/string/c32s.c.clang.o -c src/basic/string/c32s.c
    In file included from include/basic/shared.h:5,
                     from include/basic/buffer.h:4,
                     from include/basic/_/_buffer.h:3,
                     from include/basic/_/_string.h:3,
                     from src/basic/string/c32s.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/string/tchs.c.clang.o -c src/basic/string/tchs.c
    In file included from include/basic/shared.h:5,
                     from include/basic/buffer.h:4,
                     from include/basic/_/_buffer.h:3,
                     from include/basic/_/_string.h:3,
                     from src/basic/string/tchs.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/string/text.c.clang.o -c src/basic/string/text.c
    In file included from include/basic/shared.h:5,
                     from include/basic/buffer.h:4,
                     from include/basic/_/_buffer.h:3,
                     from include/basic/_/_string.h:3,
                     from src/basic/string/text.c:1:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/string/uchs.c.clang.o -c src/basic/string/uchs.c
    In file included from include/basic/shared.h:5,
                     from include/basic/buffer.h:4,
                     from include/basic/_/_buffer.h:3,
                     from include/basic/_/_string.h:3,
                     from src/basic/string/uchs.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o src/basic/string/wchs.c.clang.o -c src/basic/string/wchs.c
    In file included from include/basic/shared.h:5,
                     from include/basic/buffer.h:4,
                     from include/basic/_/_buffer.h:3,
                     from include/basic/_/_string.h:3,
                     from src/basic/string/wchs.c:2:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    cc -fPIC -shared   -Wl,-rpath,. -fPIC -shared -o bin/libbasic.clang.so src/basic/agedby.c.clang.o src/basic/branch.c.clang.o src/basic/buffer.c.clang.o src/basic/defect.c.clang.o src/basic/encode.c.clang.o src/basic/moment.c.clang.o src/basic/pipefd.c.clang.o src/basic/shared.c.clang.o src/basic/thread.c.clang.o src/basic/buffer/dints.c.clang.o src/basic/buffer/voids.c.clang.o src/basic/string/achs.c.clang.o src/basic/string/c16s.c.clang.o src/basic/string/c32s.c.clang.o src/basic/string/tchs.c.clang.o src/basic/string/text.c.clang.o src/basic/string/uchs.c.clang.o src/basic/string/wchs.c.clang.o -l pthread -l dl -l m
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-b2410d607f591fc40124f1f6075251ede82190bb" -o test/basic/main.c.clang.o -c test/basic/main.c
    In file included from include/basic/thread.h:4,
                     from test/basic/main.c:1:
    include/basic/defect.h:59: warning: "ECHO_CODE" redefined
       59 | #define ECHO_CODE( OUT, X ) X
          | 
    include/basic/defect.h:47: note: this is the location of the previous definition
       47 | #define ECHO_CODE( OUT, X ) fprintf( OUT, LINEF "%s\n", LINEV, #X ); X
          | 
    test/basic/main.c: In function ‘TestPseudoMutex’:
    test/basic/main.c:17:14: error: ‘SRC’ undeclared (first use in this function)
       17 |  void *ud = (SRC*)act;
          |              ^~~
    test/basic/main.c:17:14: note: each undeclared identifier is reported only once for each function it appears in
    test/basic/main.c:17:18: error: expected expression before ‘)’ token
       17 |  void *ud = (SRC*)act;
          |                  ^
    test/basic/main.c:21:3: warning: implicit declaration of function ‘PauseThread’; did you mean ‘MakeThread’? [-Wimplicit-function-declaration]
       21 |   PauseThread();
          |   ^~~~~~~~~~~
          |   MakeThread
    test/basic/main.c:24:2: warning: implicit declaration of function ‘GrabSiData’; did you mean ‘GrabMiData’? [-Wimplicit-function-declaration]
       24 |  GrabSiData( &global_sidata, src, stdout );
          |  ^~~~~~~~~~
          |  GrabMiData
    test/basic/main.c:24:15: error: ‘global_sidata’ undeclared (first use in this function)
       24 |  GrabSiData( &global_sidata, src, stdout );
          |               ^~~~~~~~~~~~~
    test/basic/main.c:24:30: error: ‘src’ undeclared (first use in this function)
       24 |  GrabSiData( &global_sidata, src, stdout );
          |                              ^~~
    test/basic/main.c:17:8: warning: unused variable ‘ud’ [-Wunused-variable]
       17 |  void *ud = (SRC*)act;
          |        ^~
    test/basic/main.c: In function ‘HelloWorld’:
    test/basic/main.c:36:14: error: ‘SRC’ undeclared (first use in this function)
       36 |  void *ud = (SRC*)act;
          |              ^~~
    test/basic/main.c:36:18: error: expected expression before ‘)’ token
       36 |  void *ud = (SRC*)act;
          |                  ^
    test/basic/main.c:38:16: warning: implicit declaration of function ‘ThreadSeekRidsVoids’; did you mean ‘SeekRidsVoids’? [-Wimplicit-function-declaration]
       38 |  VOIDS *rids = ThreadSeekRidsVoids(act);
          |                ^~~~~~~~~~~~~~~~~~~
          |                SeekRidsVoids
    test/basic/main.c:38:16: warning: initialization of ‘VOIDS *’ {aka ‘struct _BUFFER *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
    test/basic/main.c:39:28: error: ‘top’ undeclared (first use in this function)
       39 |  ARGS *args = SeekThreadUD(top);
          |                            ^~~
    test/basic/main.c:42:35: error: expected expression before ‘)’ token
       42 |  args->stdout_rid = MakeRid( (SRC*)act, stdout );
          |                                   ^
    test/basic/main.c:42:21: error: too few arguments to function ‘MakeRid’
       42 |  args->stdout_rid = MakeRid( (SRC*)act, stdout );
          |                     ^~~~~~~
    In file included from include/basic/thread.h:9,
                     from test/basic/main.c:1:
    include/basic/buffer/voids.h:14:12: note: declared here
       14 | BASIC uint MakeRid(  void *ud, void *ptr );
          |            ^~~~~~~
    test/basic/main.c:44:15: error: ‘global_sidata’ undeclared (first use in this function)
       44 |  GrabSiData( &global_sidata, src, stdout );
          |               ^~~~~~~~~~~~~
    test/basic/main.c:44:30: error: ‘src’ undeclared (first use in this function)
       44 |  GrabSiData( &global_sidata, src, stdout );
          |                              ^~~
    test/basic/main.c:37:10: warning: unused variable ‘anchor’ [-Wunused-variable]
       37 |  THREAD *anchor = AnchorThread();
          |          ^~~~~~
    test/basic/main.c:36:8: warning: unused variable ‘ud’ [-Wunused-variable]
       36 |  void *ud = (SRC*)act;
          |        ^~
    test/basic/main.c: In function ‘main’:
    test/basic/main.c:84:21: warning: passing argument 1 of ‘ExecThreads’ makes pointer from integer without a cast [-Wint-conversion]
       84 |  err = ExecThreads( true, HelloWorld );
          |                     ^~~~
          |                     |
          |                     int
    In file included from test/basic/main.c:1:
    include/basic/thread.h:29:32: note: expected ‘void *’ but argument is of type ‘int’
       29 | BASIC dint  ExecThreads( void *ud, bool debug, Thread_cb Run );
          |                          ~~~~~~^~
    test/basic/main.c:84:2: warning: the address of ‘HelloWorld’ will always evaluate as ‘true’ [-Waddress]
       84 |  err = ExecThreads( true, HelloWorld );
          |  ^~~
    test/basic/main.c:84:8: error: too few arguments to function ‘ExecThreads’
       84 |  err = ExecThreads( true, HelloWorld );
          |        ^~~~~~~~~~~
    In file included from test/basic/main.c:1:
    include/basic/thread.h:29:13: note: declared here
       29 | BASIC dint  ExecThreads( void *ud, bool debug, Thread_cb Run );
          |             ^~~~~~~~~~~
    make: *** [gnu.mak:67: test/basic/main.c.clang.o] Error 1
    Last edited by rstanley; 01-29-2022 at 02:25 PM.

  3. #3
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733
    I've never gotten those errors, I'll have to take a closer look at what clang defaults as, anyways a complete rebuild gives me no errors so I can only try and look based on the results you gave me

    Edit: Just for your satisfaction I tried switching compiler to gcc, still no errors, did you edit the compile options or something?
    Code:
    make CC=gcc debug=1 rebuild
    include ../makefile
    include ../../makefile
    ext_pfx=.d.clang
    include ../../gnu.mak
    rm -f ../../test/basic/*.o
    rm -f ../../test/extra/*.o
    rm -f ../../src/basic/*.o ../../src/basic/*/*.o
    rm -f ../../src/extra/*.o ../../src/extra/*/*.o ../../src/extra/*/*/*.o
    rm -f ../../test/basic/*.obj
    rm -f ../../test/extra/*.obj
    rm -f ../../src/basic/*.obj ../../src/basic/*/*.obj
    rm -f ../../src/extra/*.obj ../../src/extra/*/*.obj ../../src/extra/*/*/*.obj
    rm -f ../../lib/*basic*.a ../../lib/*extra*.a
    rm -f ../../lib/*basic*.lib ../../lib/*extra*.lib
    rm -f ../../bin/*basic*.so ../../bin/*extra*.so
    rm -f ../../bin/*basic*.dll ../../bin/*extra*.dll
    rm -f ../../bin/*basic*.out ../../bin/*extra*.out
    rm -f ../../bin/*basic*.elf ../../bin/*extra*.elf
    rm -f ../../bin/*basic*.app ../../bin/*extra*.app
    rm -f ../../bin/*basic*.exe ../../bin/*extra*.exe
    rm -f ../../bin/*basic*.AppImage ../../bin/*extra*.AppImage
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/agedby.c.d.clang.o -c ../../src/basic/agedby.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/branch.c.d.clang.o -c ../../src/basic/branch.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/buffer.c.d.clang.o -c ../../src/basic/buffer.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/defect.c.d.clang.o -c ../../src/basic/defect.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/encode.c.d.clang.o -c ../../src/basic/encode.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/moment.c.d.clang.o -c ../../src/basic/moment.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/pipefd.c.d.clang.o -c ../../src/basic/pipefd.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/shared.c.d.clang.o -c ../../src/basic/shared.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/thread.c.d.clang.o -c ../../src/basic/thread.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/buffer/dints.c.d.clang.o -c ../../src/basic/buffer/dints.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/buffer/voids.c.d.clang.o -c ../../src/basic/buffer/voids.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/achs.c.d.clang.o -c ../../src/basic/string/achs.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/c16s.c.d.clang.o -c ../../src/basic/string/c16s.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/c32s.c.d.clang.o -c ../../src/basic/string/c32s.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/tchs.c.d.clang.o -c ../../src/basic/string/tchs.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/text.c.d.clang.o -c ../../src/basic/string/text.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/uchs.c.d.clang.o -c ../../src/basic/string/uchs.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/wchs.c.d.clang.o -c ../../src/basic/string/wchs.c
    gcc -fPIC -shared  -ggdb -Wl,-rpath,. -fPIC -shared -o ../../bin/libbasic.d.clang.so ../../src/basic/agedby.c.d.clang.o ../../src/basic/branch.c.d.clang.o ../../src/basic/buffer.c.d.clang.o ../../src/basic/defect.c.d.clang.o ../../src/basic/encode.c.d.clang.o ../../src/basic/moment.c.d.clang.o ../../src/basic/pipefd.c.d.clang.o ../../src/basic/shared.c.d.clang.o ../../src/basic/thread.c.d.clang.o ../../src/basic/buffer/dints.c.d.clang.o ../../src/basic/buffer/voids.c.d.clang.o ../../src/basic/string/achs.c.d.clang.o ../../src/basic/string/c16s.c.d.clang.o ../../src/basic/string/c32s.c.d.clang.o ../../src/basic/string/tchs.c.d.clang.o ../../src/basic/string/text.c.d.clang.o ../../src/basic/string/uchs.c.d.clang.o ../../src/basic/string/wchs.c.d.clang.o -l pthread -l dl -l m
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/shader.c.d.clang.o -c ../../src/extra/viewfx/shader.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxapi.c.d.clang.o -c ../../src/extra/viewfx/vfxapi.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxapp.c.d.clang.o -c ../../src/extra/viewfx/vfxapp.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxbuf.c.d.clang.o -c ../../src/extra/viewfx/vfxbuf.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxcfg.c.d.clang.o -c ../../src/extra/viewfx/vfxcfg.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxdef.c.d.clang.o -c ../../src/extra/viewfx/vfxdef.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxvar.c.d.clang.o -c ../../src/extra/viewfx/vfxvar.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxwin.c.d.clang.o -c ../../src/extra/viewfx/vfxwin.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/zipped/zlib.c.d.clang.o -c ../../src/extra/zipped/zlib.c
    gcc  -ggdb -Wl,-rpath,. -fPIC -shared -o ../../bin/libextra.d.clang.so ../../src/extra/viewfx/shader.c.d.clang.o ../../src/extra/viewfx/vfxapi.c.d.clang.o ../../src/extra/viewfx/vfxapp.c.d.clang.o ../../src/extra/viewfx/vfxbuf.c.d.clang.o ../../src/extra/viewfx/vfxcfg.c.d.clang.o ../../src/extra/viewfx/vfxdef.c.d.clang.o ../../src/extra/viewfx/vfxvar.c.d.clang.o ../../src/extra/viewfx/vfxwin.c.d.clang.o ../../src/extra/zipped/zlib.c.d.clang.o  -l basic.d.clang
    ar rcs ../../lib/libextra.d.clang.a ../../src/extra/viewfx/shader.c.d.clang.o ../../src/extra/viewfx/vfxapi.c.d.clang.o ../../src/extra/viewfx/vfxapp.c.d.clang.o ../../src/extra/viewfx/vfxbuf.c.d.clang.o ../../src/extra/viewfx/vfxcfg.c.d.clang.o ../../src/extra/viewfx/vfxdef.c.d.clang.o ../../src/extra/viewfx/vfxvar.c.d.clang.o ../../src/extra/viewfx/vfxwin.c.d.clang.o ../../src/extra/zipped/zlib.c.d.clang.o
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/glfw/glfw_eio.c.d.clang.o -c ../../src/extra/viewfx/glfw/glfw_eio.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/glfw/glfw_vfxkey.c.d.clang.o -c ../../src/extra/viewfx/glfw/glfw_vfxkey.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/glfw/glfw_vfxwai.c.d.clang.o -c ../../src/extra/viewfx/glfw/glfw_vfxwai.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/glfw/glfw_vfxwin.c.d.clang.o -c ../../src/extra/viewfx/glfw/glfw_vfxwin.c
    gcc -fPIC -shared  -ggdb -Wl,-rpath,. -o ../../bin/libvfxglfw.d.clang.so ../../src/extra/viewfx/glfw/glfw_eio.c.d.clang.o ../../src/extra/viewfx/glfw/glfw_vfxkey.c.d.clang.o ../../src/extra/viewfx/glfw/glfw_vfxwai.c.d.clang.o ../../src/extra/viewfx/glfw/glfw_vfxwin.c.d.clang.o -l basic.d.clang -l extra.d.clang -l glfw -l GLEW
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_defect.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_defect.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_shader.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_shader.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxapi.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxapi.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxapp.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxapp.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxbuf.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxbuf.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxcfg.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxcfg.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxdef.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxdef.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxvar.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxvar.c
    gcc -fPIC -shared  -o ../../bin/libvfxgl.d.clang.so ../../src/extra/viewfx/gl/opengl_defect.c.d.clang.o ../../src/extra/viewfx/gl/opengl_shader.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxapi.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxapp.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxbuf.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxcfg.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxdef.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxvar.c.d.clang.o -l basic.d.clang -l extra.d.clang -l GLEW
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../test/extra/create.c.d.clang.o -c ../../test/extra/create.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../test/extra/debug.c.d.clang.o -c ../../test/extra/debug.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../test/extra/lib.c.d.clang.o -c ../../test/extra/lib.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../test/extra/main.c.d.clang.o -c ../../test/extra/main.c
    gcc  -ggdb -Wl,-rpath,. -o ../../bin/check_extra.d.clang.elf ../../test/extra/create.c.d.clang.o ../../test/extra/debug.c.d.clang.o ../../test/extra/lib.c.d.clang.o ../../test/extra/main.c.d.clang.o -l basic.d.clang -l extra.d.clang  -l pthread -l dl -l m
    Compilation finished successfully.

  4. #4
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733
    Quote Originally Posted by awsdert View Post
    I've never gotten those errors, I'll have to take a closer look at what clang defaults as, anyways a complete rebuild gives me no errors so I can only try and look based on the results you gave me

    Edit: Just for your satisfaction I tried switching compiler to gcc, still no errors, did you edit the compile options or something?
    Code:
    make CC=gcc debug=1 rebuild
    include ../makefile
    include ../../makefile
    ext_pfx=.d.clang
    include ../../gnu.mak
    rm -f ../../test/basic/*.o
    rm -f ../../test/extra/*.o
    rm -f ../../src/basic/*.o ../../src/basic/*/*.o
    rm -f ../../src/extra/*.o ../../src/extra/*/*.o ../../src/extra/*/*/*.o
    rm -f ../../test/basic/*.obj
    rm -f ../../test/extra/*.obj
    rm -f ../../src/basic/*.obj ../../src/basic/*/*.obj
    rm -f ../../src/extra/*.obj ../../src/extra/*/*.obj ../../src/extra/*/*/*.obj
    rm -f ../../lib/*basic*.a ../../lib/*extra*.a
    rm -f ../../lib/*basic*.lib ../../lib/*extra*.lib
    rm -f ../../bin/*basic*.so ../../bin/*extra*.so
    rm -f ../../bin/*basic*.dll ../../bin/*extra*.dll
    rm -f ../../bin/*basic*.out ../../bin/*extra*.out
    rm -f ../../bin/*basic*.elf ../../bin/*extra*.elf
    rm -f ../../bin/*basic*.app ../../bin/*extra*.app
    rm -f ../../bin/*basic*.exe ../../bin/*extra*.exe
    rm -f ../../bin/*basic*.AppImage ../../bin/*extra*.AppImage
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/agedby.c.d.clang.o -c ../../src/basic/agedby.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/branch.c.d.clang.o -c ../../src/basic/branch.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/buffer.c.d.clang.o -c ../../src/basic/buffer.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/defect.c.d.clang.o -c ../../src/basic/defect.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/encode.c.d.clang.o -c ../../src/basic/encode.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/moment.c.d.clang.o -c ../../src/basic/moment.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/pipefd.c.d.clang.o -c ../../src/basic/pipefd.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/shared.c.d.clang.o -c ../../src/basic/shared.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/thread.c.d.clang.o -c ../../src/basic/thread.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/buffer/dints.c.d.clang.o -c ../../src/basic/buffer/dints.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/buffer/voids.c.d.clang.o -c ../../src/basic/buffer/voids.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/achs.c.d.clang.o -c ../../src/basic/string/achs.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/c16s.c.d.clang.o -c ../../src/basic/string/c16s.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/c32s.c.d.clang.o -c ../../src/basic/string/c32s.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/tchs.c.d.clang.o -c ../../src/basic/string/tchs.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/text.c.d.clang.o -c ../../src/basic/string/text.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/uchs.c.d.clang.o -c ../../src/basic/string/uchs.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/basic/string/wchs.c.d.clang.o -c ../../src/basic/string/wchs.c
    gcc -fPIC -shared  -ggdb -Wl,-rpath,. -fPIC -shared -o ../../bin/libbasic.d.clang.so ../../src/basic/agedby.c.d.clang.o ../../src/basic/branch.c.d.clang.o ../../src/basic/buffer.c.d.clang.o ../../src/basic/defect.c.d.clang.o ../../src/basic/encode.c.d.clang.o ../../src/basic/moment.c.d.clang.o ../../src/basic/pipefd.c.d.clang.o ../../src/basic/shared.c.d.clang.o ../../src/basic/thread.c.d.clang.o ../../src/basic/buffer/dints.c.d.clang.o ../../src/basic/buffer/voids.c.d.clang.o ../../src/basic/string/achs.c.d.clang.o ../../src/basic/string/c16s.c.d.clang.o ../../src/basic/string/c32s.c.d.clang.o ../../src/basic/string/tchs.c.d.clang.o ../../src/basic/string/text.c.d.clang.o ../../src/basic/string/uchs.c.d.clang.o ../../src/basic/string/wchs.c.d.clang.o -l pthread -l dl -l m
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/shader.c.d.clang.o -c ../../src/extra/viewfx/shader.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxapi.c.d.clang.o -c ../../src/extra/viewfx/vfxapi.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxapp.c.d.clang.o -c ../../src/extra/viewfx/vfxapp.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxbuf.c.d.clang.o -c ../../src/extra/viewfx/vfxbuf.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxcfg.c.d.clang.o -c ../../src/extra/viewfx/vfxcfg.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxdef.c.d.clang.o -c ../../src/extra/viewfx/vfxdef.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxvar.c.d.clang.o -c ../../src/extra/viewfx/vfxvar.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/vfxwin.c.d.clang.o -c ../../src/extra/viewfx/vfxwin.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/zipped/zlib.c.d.clang.o -c ../../src/extra/zipped/zlib.c
    gcc  -ggdb -Wl,-rpath,. -fPIC -shared -o ../../bin/libextra.d.clang.so ../../src/extra/viewfx/shader.c.d.clang.o ../../src/extra/viewfx/vfxapi.c.d.clang.o ../../src/extra/viewfx/vfxapp.c.d.clang.o ../../src/extra/viewfx/vfxbuf.c.d.clang.o ../../src/extra/viewfx/vfxcfg.c.d.clang.o ../../src/extra/viewfx/vfxdef.c.d.clang.o ../../src/extra/viewfx/vfxvar.c.d.clang.o ../../src/extra/viewfx/vfxwin.c.d.clang.o ../../src/extra/zipped/zlib.c.d.clang.o  -l basic.d.clang
    ar rcs ../../lib/libextra.d.clang.a ../../src/extra/viewfx/shader.c.d.clang.o ../../src/extra/viewfx/vfxapi.c.d.clang.o ../../src/extra/viewfx/vfxapp.c.d.clang.o ../../src/extra/viewfx/vfxbuf.c.d.clang.o ../../src/extra/viewfx/vfxcfg.c.d.clang.o ../../src/extra/viewfx/vfxdef.c.d.clang.o ../../src/extra/viewfx/vfxvar.c.d.clang.o ../../src/extra/viewfx/vfxwin.c.d.clang.o ../../src/extra/zipped/zlib.c.d.clang.o
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/glfw/glfw_eio.c.d.clang.o -c ../../src/extra/viewfx/glfw/glfw_eio.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/glfw/glfw_vfxkey.c.d.clang.o -c ../../src/extra/viewfx/glfw/glfw_vfxkey.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/glfw/glfw_vfxwai.c.d.clang.o -c ../../src/extra/viewfx/glfw/glfw_vfxwai.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/glfw/glfw_vfxwin.c.d.clang.o -c ../../src/extra/viewfx/glfw/glfw_vfxwin.c
    gcc -fPIC -shared  -ggdb -Wl,-rpath,. -o ../../bin/libvfxglfw.d.clang.so ../../src/extra/viewfx/glfw/glfw_eio.c.d.clang.o ../../src/extra/viewfx/glfw/glfw_vfxkey.c.d.clang.o ../../src/extra/viewfx/glfw/glfw_vfxwai.c.d.clang.o ../../src/extra/viewfx/glfw/glfw_vfxwin.c.d.clang.o -l basic.d.clang -l extra.d.clang -l glfw -l GLEW
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_defect.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_defect.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_shader.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_shader.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxapi.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxapi.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxapp.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxapp.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxbuf.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxbuf.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxcfg.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxcfg.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxdef.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxdef.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../src/extra/viewfx/gl/opengl_vfxvar.c.d.clang.o -c ../../src/extra/viewfx/gl/opengl_vfxvar.c
    gcc -fPIC -shared  -o ../../bin/libvfxgl.d.clang.so ../../src/extra/viewfx/gl/opengl_defect.c.d.clang.o ../../src/extra/viewfx/gl/opengl_shader.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxapi.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxapp.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxbuf.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxcfg.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxdef.c.d.clang.o ../../src/extra/viewfx/gl/opengl_vfxvar.c.d.clang.o -l basic.d.clang -l extra.d.clang -l GLEW
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../test/extra/create.c.d.clang.o -c ../../test/extra/create.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../test/extra/debug.c.d.clang.o -c ../../test/extra/debug.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../test/extra/lib.c.d.clang.o -c ../../test/extra/lib.c
    gcc  -ggdb -D _DEBUG -Wall -Wextra -fPIC   -D _EXT_PFX=".d.clang" -D USING=gnu.mak -D TOP_DIR=../../  -o ../../test/extra/main.c.d.clang.o -c ../../test/extra/main.c
    gcc  -ggdb -Wl,-rpath,. -o ../../bin/check_extra.d.clang.elf ../../test/extra/create.c.d.clang.o ../../test/extra/debug.c.d.clang.o ../../test/extra/lib.c.d.clang.o ../../test/extra/main.c.d.clang.o -l basic.d.clang -l extra.d.clang  -l pthread -l dl -l m
    Compilation finished successfully.
    Never mind, turns out those errors only show up in release builds, just fixed the causes of the issues so gonna upload it now

    Edit: Coulda sworn I hit edit for the above, whatever, anyways the fix for those compile issues is now in place:

    Files * 791097a98cb0cdf32470f52784656a1df7c9d32e * Lee Shallis / Dragonbuilder * GitLab

  5. #5
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,110
    Quote Originally Posted by awsdert View Post
    I've never gotten those errors, I'll have to take a closer look at what clang defaults as, anyways a complete rebuild gives me no errors so I can only try and look based on the results you gave me
    Make sure you are ramping up the warning level in clang to the highest level.

    I downloaded the zip file using the link you provided:

    dragonbuilder

    Unzipped the file, and ran the gnu make. No changes made.

    Debian Linux stable, gcc version: 10.2.1

  6. #6
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733
    Quote Originally Posted by rstanley View Post
    Make sure you are ramping up the warning level in clang to the highest level.

    I downloaded the zip file using the link you provided:

    dragonbuilder

    Unzipped the file, and ran the gnu make. No changes made.

    Debian Linux stable, gcc version: 10.2.1
    There should be, both issues were in include/basic/defect.h, one was obviously the redefine (just delete the 1st ECHO_CODE outside the #ifdef _DEBUG block) and the 2nd was because of a left over ; character at the end of the #define ECHO_CALL macro (had X; instead of X)

  7. #7
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,110
    Quote Originally Posted by awsdert View Post
    There should be, both issues were in include/basic/defect.h, one was obviously the redefine (just delete the 1st ECHO_CODE outside the #ifdef _DEBUG block) and the 2nd was because of a left over ; character at the end of the #define ECHO_CALL macro (had X; instead of X)
    Please make sure your code compiles FULLY CLEAN, before posting, and asking for help! You obviously have errors in your code no matter which compiler you are using! Please check and correct ALL the below warnings and errors!!!

    Using the code downloaded from your latest posting:
    Code:
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-791097a98cb0cdf32470f52784656a1df7c9d32e" -o test/basic/main.c.clang.o -c test/basic/main.c
    test/basic/main.c: In function ‘TestPseudoMutex’:
    test/basic/main.c:17:14: error: ‘SRC’ undeclared (first use in this function)
       17 |  void *ud = (SRC*)act;
          |              ^~~
    test/basic/main.c:17:14: note: each undeclared identifier is reported only once for each function it appears in
    test/basic/main.c:17:18: error: expected expression before ‘)’ token
       17 |  void *ud = (SRC*)act;
          |                  ^
    test/basic/main.c:21:3: warning: implicit declaration of function ‘PauseThread’; did you mean ‘MakeThread’? [-Wimplicit-function-declaration]
       21 |   PauseThread();
          |   ^~~~~~~~~~~
          |   MakeThread
    test/basic/main.c:24:2: warning: implicit declaration of function ‘GrabSiData’; did you mean ‘GrabMiData’? [-Wimplicit-function-declaration]
       24 |  GrabSiData( &global_sidata, src, stdout );
          |  ^~~~~~~~~~
          |  GrabMiData
    test/basic/main.c:24:15: error: ‘global_sidata’ undeclared (first use in this function)
       24 |  GrabSiData( &global_sidata, src, stdout );
          |               ^~~~~~~~~~~~~
    test/basic/main.c:24:30: error: ‘src’ undeclared (first use in this function)
       24 |  GrabSiData( &global_sidata, src, stdout );
          |                              ^~~
    test/basic/main.c:17:8: warning: unused variable ‘ud’ [-Wunused-variable]
       17 |  void *ud = (SRC*)act;
          |        ^~
    test/basic/main.c: In function ‘HelloWorld’:
    test/basic/main.c:36:14: error: ‘SRC’ undeclared (first use in this function)
       36 |  void *ud = (SRC*)act;
          |              ^~~
    test/basic/main.c:36:18: error: expected expression before ‘)’ token
       36 |  void *ud = (SRC*)act;
          |                  ^
    test/basic/main.c:38:16: warning: implicit declaration of function ‘ThreadSeekRidsVoids’; did you mean ‘SeekRidsVoids’? [-Wimplicit-function-declaration]
       38 |  VOIDS *rids = ThreadSeekRidsVoids(act);
          |                ^~~~~~~~~~~~~~~~~~~
          |                SeekRidsVoids
    test/basic/main.c:38:16: warning: initialization of ‘VOIDS *’ {aka ‘struct _BUFFER *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
    test/basic/main.c:39:28: error: ‘top’ undeclared (first use in this function)
       39 |  ARGS *args = SeekThreadUD(top);
          |                            ^~~
    test/basic/main.c:42:35: error: expected expression before ‘)’ token
       42 |  args->stdout_rid = MakeRid( (SRC*)act, stdout );
          |                                   ^
    test/basic/main.c:42:21: error: too few arguments to function ‘MakeRid’
       42 |  args->stdout_rid = MakeRid( (SRC*)act, stdout );
          |                     ^~~~~~~
    In file included from include/basic/thread.h:9,
                     from test/basic/main.c:1:
    include/basic/buffer/voids.h:14:12: note: declared here
       14 | BASIC uint MakeRid(  void *ud, void *ptr );
          |            ^~~~~~~
    test/basic/main.c:44:15: error: ‘global_sidata’ undeclared (first use in this function)
       44 |  GrabSiData( &global_sidata, src, stdout );
          |               ^~~~~~~~~~~~~
    test/basic/main.c:44:30: error: ‘src’ undeclared (first use in this function)
       44 |  GrabSiData( &global_sidata, src, stdout );
          |                              ^~~
    test/basic/main.c:37:10: warning: unused variable ‘anchor’ [-Wunused-variable]
       37 |  THREAD *anchor = AnchorThread();
          |          ^~~~~~
    test/basic/main.c:36:8: warning: unused variable ‘ud’ [-Wunused-variable]
       36 |  void *ud = (SRC*)act;
          |        ^~
    test/basic/main.c: In function ‘main’:
    test/basic/main.c:84:21: warning: passing argument 1 of ‘ExecThreads’ makes pointer from integer without a cast [-Wint-conversion]
       84 |  err = ExecThreads( true, HelloWorld );
          |                     ^~~~
          |                     |
          |                     int
    In file included from test/basic/main.c:1:
    include/basic/thread.h:29:32: note: expected ‘void *’ but argument is of type ‘int’
       29 | BASIC dint  ExecThreads( void *ud, bool debug, Thread_cb Run );
          |                          ~~~~~~^~
    test/basic/main.c:84:2: warning: the address of ‘HelloWorld’ will always evaluate as ‘true’ [-Waddress]
       84 |  err = ExecThreads( true, HelloWorld );
          |  ^~~
    test/basic/main.c:84:8: error: too few arguments to function ‘ExecThreads’
       84 |  err = ExecThreads( true, HelloWorld );
          |        ^~~~~~~~~~~
    In file included from test/basic/main.c:1:
    include/basic/thread.h:29:13: note: declared here
       29 | BASIC dint  ExecThreads( void *ud, bool debug, Thread_cb Run );
          |             ^~~~~~~~~~~
    make: *** [gnu.mak:67: test/basic/main.c.clang.o] Error 1

  8. #8
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733
    Quote Originally Posted by rstanley View Post
    Please make sure your code compiles FULLY CLEAN, before posting, and asking for help! You obviously have errors in your code no matter which compiler you are using! Please check and correct ALL the below warnings and errors!!!

    Using the code downloaded from your latest posting:
    Code:
    cc   -Wall -Wextra -fPIC   -D _EXT_PFX=".clang" -D USING=gnu.mak -D _DIR="/home/other/temp/dragonbuilder-791097a98cb0cdf32470f52784656a1df7c9d32e" -o test/basic/main.c.clang.o -c test/basic/main.c
    test/basic/main.c: In function ‘TestPseudoMutex’:
    test/basic/main.c:17:14: error: ‘SRC’ undeclared (first use in this function)
       17 |  void *ud = (SRC*)act;
          |              ^~~
    test/basic/main.c:17:14: note: each undeclared identifier is reported only once for each function it appears in
    test/basic/main.c:17:18: error: expected expression before ‘)’ token
       17 |  void *ud = (SRC*)act;
          |                  ^
    test/basic/main.c:21:3: warning: implicit declaration of function ‘PauseThread’; did you mean ‘MakeThread’? [-Wimplicit-function-declaration]
       21 |   PauseThread();
          |   ^~~~~~~~~~~
          |   MakeThread
    test/basic/main.c:24:2: warning: implicit declaration of function ‘GrabSiData’; did you mean ‘GrabMiData’? [-Wimplicit-function-declaration]
       24 |  GrabSiData( &global_sidata, src, stdout );
          |  ^~~~~~~~~~
          |  GrabMiData
    test/basic/main.c:24:15: error: ‘global_sidata’ undeclared (first use in this function)
       24 |  GrabSiData( &global_sidata, src, stdout );
          |               ^~~~~~~~~~~~~
    test/basic/main.c:24:30: error: ‘src’ undeclared (first use in this function)
       24 |  GrabSiData( &global_sidata, src, stdout );
          |                              ^~~
    test/basic/main.c:17:8: warning: unused variable ‘ud’ [-Wunused-variable]
       17 |  void *ud = (SRC*)act;
          |        ^~
    test/basic/main.c: In function ‘HelloWorld’:
    test/basic/main.c:36:14: error: ‘SRC’ undeclared (first use in this function)
       36 |  void *ud = (SRC*)act;
          |              ^~~
    test/basic/main.c:36:18: error: expected expression before ‘)’ token
       36 |  void *ud = (SRC*)act;
          |                  ^
    test/basic/main.c:38:16: warning: implicit declaration of function ‘ThreadSeekRidsVoids’; did you mean ‘SeekRidsVoids’? [-Wimplicit-function-declaration]
       38 |  VOIDS *rids = ThreadSeekRidsVoids(act);
          |                ^~~~~~~~~~~~~~~~~~~
          |                SeekRidsVoids
    test/basic/main.c:38:16: warning: initialization of ‘VOIDS *’ {aka ‘struct _BUFFER *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
    test/basic/main.c:39:28: error: ‘top’ undeclared (first use in this function)
       39 |  ARGS *args = SeekThreadUD(top);
          |                            ^~~
    test/basic/main.c:42:35: error: expected expression before ‘)’ token
       42 |  args->stdout_rid = MakeRid( (SRC*)act, stdout );
          |                                   ^
    test/basic/main.c:42:21: error: too few arguments to function ‘MakeRid’
       42 |  args->stdout_rid = MakeRid( (SRC*)act, stdout );
          |                     ^~~~~~~
    In file included from include/basic/thread.h:9,
                     from test/basic/main.c:1:
    include/basic/buffer/voids.h:14:12: note: declared here
       14 | BASIC uint MakeRid(  void *ud, void *ptr );
          |            ^~~~~~~
    test/basic/main.c:44:15: error: ‘global_sidata’ undeclared (first use in this function)
       44 |  GrabSiData( &global_sidata, src, stdout );
          |               ^~~~~~~~~~~~~
    test/basic/main.c:44:30: error: ‘src’ undeclared (first use in this function)
       44 |  GrabSiData( &global_sidata, src, stdout );
          |                              ^~~
    test/basic/main.c:37:10: warning: unused variable ‘anchor’ [-Wunused-variable]
       37 |  THREAD *anchor = AnchorThread();
          |          ^~~~~~
    test/basic/main.c:36:8: warning: unused variable ‘ud’ [-Wunused-variable]
       36 |  void *ud = (SRC*)act;
          |        ^~
    test/basic/main.c: In function ‘main’:
    test/basic/main.c:84:21: warning: passing argument 1 of ‘ExecThreads’ makes pointer from integer without a cast [-Wint-conversion]
       84 |  err = ExecThreads( true, HelloWorld );
          |                     ^~~~
          |                     |
          |                     int
    In file included from test/basic/main.c:1:
    include/basic/thread.h:29:32: note: expected ‘void *’ but argument is of type ‘int’
       29 | BASIC dint  ExecThreads( void *ud, bool debug, Thread_cb Run );
          |                          ~~~~~~^~
    test/basic/main.c:84:2: warning: the address of ‘HelloWorld’ will always evaluate as ‘true’ [-Waddress]
       84 |  err = ExecThreads( true, HelloWorld );
          |  ^~~
    test/basic/main.c:84:8: error: too few arguments to function ‘ExecThreads’
       84 |  err = ExecThreads( true, HelloWorld );
          |        ^~~~~~~~~~~
    In file included from test/basic/main.c:1:
    include/basic/thread.h:29:13: note: declared here
       29 | BASIC dint  ExecThreads( void *ud, bool debug, Thread_cb Run );
          |             ^~~~~~~~~~~
    make: *** [gnu.mak:67: test/basic/main.c.clang.o] Error 1
    I didn't get those errors because I didn't realise one of my targets (check_basic) was being ignored during compile, for now add check=extra to your make command because I'm cleaning up check_basic now, mostly done but the api change for pseudo muti has left me with a bit of a re-write of the inter-thread communication mechanism

    Edit: Haven't finished fixing the inter-thread communication yet but have fixed the compile errors, one oddity though is that despite having a bunch of goals that map dependencies to header files and what not the binaries &/or libraries don't get rebuilt when a source file changes so I'm gonna hafta to look into that too sometime, for now you're gonna have to use the rebuild goal whenever you change something just to get the binaries &/or libraries to run the same way the modification/s expect/s

    Files * c68f0b40fdce0ff4183e1c1e7543342a88d1ea2b * Lee Shallis / Dragonbuilder * GitLab

  9. #9
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733
    I'm going to bed, the one that should be examining is under "make check=extra run", I've done something about check_basic not building when it should in the next upload (not bothering with the link since it's irrelevant to the current problem/s), since the thread got de-railed for a bit there I'll just quote my original post as a reminder for what you're looking for if you're still inclined to look.

    Quote Originally Posted by awsdert View Post
    I'll start with the link to my code:

    Files * b2410d607f591fc40124f1f6075251ede82190bb * Lee Shallis / Dragonbuilder * GitLab

    And here's the offending function (in src/extra/viewfx/vfxdef.c):
    Code:
    VFXDEF	_vfxdefs[VFXTYPE_COUNT] = {{0}};
    
    VFXDEF const * SeekVfxDef( VFXTYPE type ) { return &_vfxdefs[type]; }
    I don't know about you lot but I can see no reason for this to ever given different addresses (the input in this case was VFXTYPE_UINT), I'm assuming it's a linkage issue but I just don't see where or how, for now here's the relevant information I can think of:

    * makefile goals are in gnu.mak
    * the test app links 2 libraries by default (libbasic*.so & libextra*.so)
    * libextra*.so rely on custom libraries that link back to it & libbasic*.so
    * the only custom libraries in use right now are libvfxgl*.so & libvfxglfw*.so (I'm sure you can guess for what purpose they hold)

    That's all I can think of, any help is appreciated
    Edit: Oh and add "debug=1" to the options when running make to build the debug versions (not yet decided how I want to add that to the builds in a coherent way without the option),I've got a goal called "gede" for running the app under gede if you got it, I don't have one for gdb since that needs to be done in terminal and I've been using geany's GUI prompt to run make and there's no way to gave input in the "Compiler Output" tab, the name of the executables will be something like check_basic.d.p.*.elf & check_extra.d.p.clang.elf, the ".d" is for debuggable, the ".p" is for profillable, the ".*" will be ".mingw", ".cygwin", ".clang", ".gcc", ".cc" or ".msc", it's to make clear which compiler built it in case there's an incompatibility of some kind

  10. #10
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733
    I see either noone had any ideas or everyone who was inclined lost their inclination, a pity either way, welp until I come up with an idea on how to fix it this thread will remain up, might add a post every now and then to prevent it getting buried & forgotten

  11. #11
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733
    Since I need to kep this thread alive anyways I'll post this unrelated issue here, I'm trying to setup a default goals for libraries but having problems:
    Makefile define:
    Code:
    # pfx, opts, libs
    define deflibgoals
    $1: $$($1_dll) $$($1_lib)
    $$($1_dll): $$($1_obj)
    	$(CC) $(shared_opts) $2 -o $(BIN_DIR)/$$@ $$($1_obj) $3
    $$($1_lib): $$($1_obj)
    	ar rcs $(LIB_DIR)/$$@ $$($1_obj)
    endef
    $(info $(call deflibgoals,deflibgoals_test,deflibgoals_a,-lm))
    ...
    goals+=basic
    basic: basic_quick basic_debug basic_gprof
    
    $(call deflibgoals,basic_quick,$(basic_opts),$(basic_libs))
    $(call deflibgoals,basic_debug,$(basic_opts),$(basic_libs))
    $(call deflibgoals,basic_gprof,$(basic_opts),$(basic_libs))
    
    $(basic_src_ents): $(basic_inc_ents)
    Output:
    Code:
    deflibgoals_test: $(deflibgoals_test_dll) $(deflibgoals_test_lib)
    $(deflibgoals_test_dll): $(deflibgoals_test_obj)
    	cc  deflibgoals_a -o bin/$@ $(deflibgoals_test_obj) -lm
    $(deflibgoals_test_lib): $(deflibgoals_test_obj)
    	ar rcs lib/$@ $(deflibgoals_test_obj)
    ...
    src/basic/cfg.mak:26: *** multiple target patterns.  Stop.
    Line 26 is the 1st call of deflibgoals, any insights as to what I did wrong?

  12. #12
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733
    Quote Originally Posted by awsdert View Post
    Since I need to kep this thread alive anyways I'll post this unrelated issue here, I'm trying to setup a default goals for libraries but having problems:
    Makefile define:
    Code:
    # pfx, opts, libs
    define deflibgoals
    $1: $$($1_dll) $$($1_lib)
    $$($1_dll): $$($1_obj)
    	$(CC) $(shared_opts) $2 -o $(BIN_DIR)/$$@ $$($1_obj) $3
    $$($1_lib): $$($1_obj)
    	ar rcs $(LIB_DIR)/$$@ $$($1_obj)
    endef
    $(info $(call deflibgoals,deflibgoals_test,deflibgoals_a,-lm))
    ...
    goals+=basic
    basic: basic_quick basic_debug basic_gprof
    
    $(call deflibgoals,basic_quick,$(basic_opts),$(basic_libs))
    $(call deflibgoals,basic_debug,$(basic_opts),$(basic_libs))
    $(call deflibgoals,basic_gprof,$(basic_opts),$(basic_libs))
    
    $(basic_src_ents): $(basic_inc_ents)
    Output:
    Code:
    deflibgoals_test: $(deflibgoals_test_dll) $(deflibgoals_test_lib)
    $(deflibgoals_test_dll): $(deflibgoals_test_obj)
    	cc  deflibgoals_a -o bin/$@ $(deflibgoals_test_obj) -lm
    $(deflibgoals_test_lib): $(deflibgoals_test_obj)
    	ar rcs lib/$@ $(deflibgoals_test_obj)
    ...
    src/basic/cfg.mak:26: *** multiple target patterns.  Stop.
    Line 26 is the 1st call of deflibgoals, any insights as to what I did wrong?
    Ended up going with a different method which achieved mostly the same effect:
    Code:
    # prj, pfx, sfx
    define deflibvar
    $(if $($1_src_files),,$(error $1_src_files macro gave '$($1_src_files)'))
    $(eval $1_$2_dll_ent=$(dll_pfx)$1$3$(dll_sfx))
    $(eval $1_$2_lib_ent=$(dll_pfx)$1$3$(lib_sfx))
    $(eval $1_$2_dll_path=$(BIN_DIR)/$($1_$2_dll_ent))
    $(eval $1_$2_lib_path=$(LIB_DIR)/$($1_$2_lib_ent))
    $(eval $1_$2_objs=$$(patsubst %,%$3$(obj_sfx),$($1_src_files)))
    $(eval $1_$2_ents=$($1_$2_objs) $($1_libs))
    $(eval $1_$2_bin=$$(if $$(static_libs),$($1_$2_lib_ent),$($1_$2_dll_ent)))
    endef
    ...
    # sfx, dependency libs, src files
    link=$(patsubst %,%$1$(obj_sfx),$3) $(patsubst %,-l%$1,$2)
    # sfx, prj, dependency libs, src files
    texe=-o $(BIN_DIR)/$2$1$(exe_sfx) $(call link,$1,$3,$4)
    tdll=-o $(BIN_DIR)/$(dll_pfx)$2$1$(dll_sfx) $(call link,$1,$3,$4)
    tlib=-o $(LIB_DIR)/$(lib_pfx)$2$1$(lib_sfx) $(call link,$1,$3,$4)
    
    exe_opts=$(BFLAGS)
    dll_opts=$(BFLAGS) $(shared_opts)
    
    #define call, opts, prj, sfx, libs, dependency libs, src files
    define link_up
    $(call $1,$2,$3,,$4,$5,$6)
    	$(call $1,$2 $(debug_opts),$3,$(debug_sfx),$4,$5,$6)
    	$(call $1,$2 $(gprof_opts),$3,$(gprof_sfx),$4,$5,$6)
    endef
    
    #define opts, prj, sfx, libs, dependency libs, src files
    cc__exe=$(CC) $(exe_opts) $1 $(call texe,$3,$2,$5,$6) $4 $(LDLIBS)
    #define opts, prj, libs, dependency libs, src files
    cc_exe=$(call link_up,cc__exe,$1,$2,$3,$4,$5)
    
    #define opts, prj, sfx, libs, dependency libs, src files
    cc__dll=$(CC) $(dll_opts) $1 $(call tdll,$3,$2,$5,$6) $4 $(LDLIBS)
    #define opts, prj, libs, dependency libs, src files
    cc_dll=$(call link_up,cc__dll,$1,$2,$3,$4,$5)
    
    #define opts, prj, sfx, libs, dependency libs, src files
    cc__lib=ar rcs $(call tlib,$3,$2,$5,$6) $4 $(LDLIBS)
    #define opts, prj, libs, dependency libs, src files
    cc_lib=$(call link_up,cc__lib,$1,$2,$3,$4,$5)
    
    ...  include $(SRC_DIR)/basic/cfg.mak
    
    ifeq "$(basic_src_dir)" ""
    
    basic_src_dir:=$(SRC_DIR)/basic
    basic_inc_dir:=$(INC_DIR)/basic
    basic_src_dirs:=$(basic_src_dir) $(wildcard $(basic_src_dir)/*/)
    basic_src_dirs:=$(basic_src_dirs:%/=%)
    basic_inc_dirs:=$(basic_inc_dir) $(wildcard $(basic_inc_dir)/*/)
    basic_inc_dirs:=$(basic_inc_dirs:%/=%)
    basic_inc_files:=$(wildcard $(basic_inc_dirs:%=%/*.h))
    basic_inc_files+=$(wildcard $(basic_src_dirs:%=%/*.h))
    basic_src_files:=$(wildcard $(basic_src_dirs:%=%/*.c))
    basic_libs:=$(if $(_WIN32),-lkernel32,-lpthread -ldl) -lm
    basic_opts:=
    basic_deps:=
    
    $(call deflibvar,basic,quick,)
    $(call deflibvar,basic,debug,$(debug_sfx))
    $(call deflibvar,basic,gprof,$(gprof_sfx))
    $(call deflibvar,basic,,$(switch_sfx))
    
    goals+=basic
    basic: $(basic_quick_objs) $(basic_debug_objs) $(basic_gprof_objs)
    	$(call cc_dll,$($@_opts),$@,$($@_libs),$($@_deps),$($@_src_files))
    	$(call cc_lib,$($@_opts),$@,$($@_libs),$($@_deps),$($@_src_files))
    
    $(basic_src_dir)/%.c$(obj_sfx): $(basic_src_dir)/%.c
    	$(call compile,$(basic_opts),$<)
    
    $(basic_src_files): $(basic_inc_files)
    
    endif
    Now (besides the dual output from 1 input issue) I only need help getting rid of this message:

    ar: libdeps specified more than once

    From this output:
    Code:
    make build
    include ../makefile
    include ../../makefile
    include ../../gnu.mak
    cc -Wl,-rpath,. -fPIC -shared  -o ../../bin/libbasic.cc.so ../../src/basic/agedby.c.cc.o ../../src/basic/branch.c.cc.o ../../src/basic/buffer.c.cc.o ../../src/basic/defect.c.cc.o ../../src/basic/encode.c.cc.o ../../src/basic/moment.c.cc.o ../../src/basic/pipefd.c.cc.o ../../src/basic/shared.c.cc.o ../../src/basic/thread.c.cc.o ../../src/basic/buffer/dints.c.cc.o ../../src/basic/buffer/voids.c.cc.o ../../src/basic/string/achs.c.cc.o ../../src/basic/string/c16s.c.cc.o ../../src/basic/string/c32s.c.cc.o ../../src/basic/string/tchs.c.cc.o ../../src/basic/string/text.c.cc.o ../../src/basic/string/uchs.c.cc.o ../../src/basic/string/wchs.c.cc.o  -lpthread -ldl -lm
    cc -Wl,-rpath,. -fPIC -shared  -ggdb -D _DEBUG -o ../../bin/libbasic.d.cc.so ../../src/basic/agedby.c.d.cc.o ../../src/basic/branch.c.d.cc.o ../../src/basic/buffer.c.d.cc.o ../../src/basic/defect.c.d.cc.o ../../src/basic/encode.c.d.cc.o ../../src/basic/moment.c.d.cc.o ../../src/basic/pipefd.c.d.cc.o ../../src/basic/shared.c.d.cc.o ../../src/basic/thread.c.d.cc.o ../../src/basic/buffer/dints.c.d.cc.o ../../src/basic/buffer/voids.c.d.cc.o ../../src/basic/string/achs.c.d.cc.o ../../src/basic/string/c16s.c.d.cc.o ../../src/basic/string/c32s.c.d.cc.o ../../src/basic/string/tchs.c.d.cc.o ../../src/basic/string/text.c.d.cc.o ../../src/basic/string/uchs.c.d.cc.o ../../src/basic/string/wchs.c.d.cc.o  -lpthread -ldl -lm
    cc -Wl,-rpath,. -fPIC -shared  -pg -D PROFILING -o ../../bin/libbasic.p.cc.so ../../src/basic/agedby.c.p.cc.o ../../src/basic/branch.c.p.cc.o ../../src/basic/buffer.c.p.cc.o ../../src/basic/defect.c.p.cc.o ../../src/basic/encode.c.p.cc.o ../../src/basic/moment.c.p.cc.o ../../src/basic/pipefd.c.p.cc.o ../../src/basic/shared.c.p.cc.o ../../src/basic/thread.c.p.cc.o ../../src/basic/buffer/dints.c.p.cc.o ../../src/basic/buffer/voids.c.p.cc.o ../../src/basic/string/achs.c.p.cc.o ../../src/basic/string/c16s.c.p.cc.o ../../src/basic/string/c32s.c.p.cc.o ../../src/basic/string/tchs.c.p.cc.o ../../src/basic/string/text.c.p.cc.o ../../src/basic/string/uchs.c.p.cc.o ../../src/basic/string/wchs.c.p.cc.o  -lpthread -ldl -lm
    ar rcs -o ../../lib/basic.cc.a ../../src/basic/agedby.c.cc.o ../../src/basic/branch.c.cc.o ../../src/basic/buffer.c.cc.o ../../src/basic/defect.c.cc.o ../../src/basic/encode.c.cc.o ../../src/basic/moment.c.cc.o ../../src/basic/pipefd.c.cc.o ../../src/basic/shared.c.cc.o ../../src/basic/thread.c.cc.o ../../src/basic/buffer/dints.c.cc.o ../../src/basic/buffer/voids.c.cc.o ../../src/basic/string/achs.c.cc.o ../../src/basic/string/c16s.c.cc.o ../../src/basic/string/c32s.c.cc.o ../../src/basic/string/tchs.c.cc.o ../../src/basic/string/text.c.cc.o ../../src/basic/string/uchs.c.cc.o ../../src/basic/string/wchs.c.cc.o  -lpthread -ldl -lm
    ar: libdeps specified more than once
    make: *** [../../src/basic/cfg.mak:24: basic] Error 1
    Compilation failed.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unpredictable results with shared library only
    By thetinman in forum C++ Programming
    Replies: 3
    Last Post: 07-10-2016, 06:21 AM
  2. Returning results from a function using pointers
    By Magi in forum C Programming
    Replies: 4
    Last Post: 11-19-2012, 05:43 PM
  3. Replies: 5
    Last Post: 09-06-2011, 02:59 PM
  4. Not returning correct results
    By drty2 in forum C Programming
    Replies: 4
    Last Post: 01-19-2009, 12:39 PM
  5. Help with struct... not returning correct results.
    By drty2 in forum C Programming
    Replies: 7
    Last Post: 01-18-2009, 11:25 PM

Tags for this Thread