1.6 development planning thread - page 5 - General Discussion and Assistance - CHDK Forum

1.6 development planning thread

  • 68 Replies
  • 16976 Views
*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: 1.6 development planning thread
« Reply #40 on: 08 / December / 2020, 18:00:48 »
Advertisements
BTW IIRC the gps code was contributed by our CHDK-DE friends @msl and/or @rudi ?
Not quite right. The initial author of the GPS functions was the user Genie from the german CHDK forum based on the SX230. rudi has revised the code based on the SX260.

Sorry for the offtopic. But the history of CHDK is great.

msl
CHDK-DE:  CHDK-DE links

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: 1.6 development planning thread
« Reply #41 on: 08 / December / 2020, 18:39:22 »
Hi phil,
Sorry for awfull typography - always struggling with html editors.It's actually GCC 10.1.1. Produces same warning as 9.3.1 plus the quoted new warnings. Was just trying to say it looks like we might be able to use 10 in the future without major headaches.

whim


Thanks for clarifying - I should have read your original more carefully :)


The linker error with GCC 10 is interesting - the copy of 'usb_HPtimer_error_count' in generic/wrappers.c is redundant and unused so removing it also fixes the error. Adding -fcommon increases the overall build size so I think removing the bogus variable would be preferable.

EDIT: GCC10 fails when building the 'eyefi' module for Digic 6 or Digic 7 cameras with the error below, unsure why this is; but could be compiler bug.
Code: [Select]
arm-none-eabi-objdump: error: .o2/eyefi.elf(.bss) section size (0x4120 bytes) is larger than file size (0x4070 bytes)
arm-none-eabi-objdump: Reading section .bss failed because: memory exhausted

Phil.
« Last Edit: 09 / December / 2020, 00:50:54 by philmoz »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: 1.6 development planning thread
« Reply #42 on: 09 / December / 2020, 14:22:26 »
Hope to save You some time with...
Code: [Select]
HOSTCFLAGS+= -Wpedantic -Wnested-externs -std=gnu11 -funsigned-char[]>:haha
« Last Edit: 10 / December / 2020, 12:40:53 by Caefix »
All lifetime is a loan from eternity.

Re: 1.6 development planning thread
« Reply #43 on: 09 / December / 2020, 19:00:38 »
Quote from: philmoz link=topic=14150.msg144699#msg144699
The linker error with GCC 10 is interesting - the copy of 'usb_HPtimer_error_count' in generic/wrappers.c is redundant and unused so removing it also fixes the error.
Pretty much everything related to HPTIMER_ERROR_COUNT and  usb_HPtimer_error_count in the usb_remote.c code is unused and I think could be safely removed.   I have not dug into why it's there in the first place - it's been  a while.
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: 1.6 development planning thread
« Reply #44 on: 10 / December / 2020, 01:39:24 »
Some more (potential) cleanup.


From what I can tell only the d2d.c and wrapper.c source files in lib/math are included in the build so the following files can be deleted:
- ef_log.c, ef_pow.c, ef_sqrt.c, fdlibm.h, rnd.c, s_copysignf.c s_scalbnf.c and sf_abs.c


Also __VFP_FP__ is defined for all of our builds and all supported GCC versions so lib/math/d2d.c is also not needed.


Any thoughts?


Phil.



CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: 1.6 development planning thread
« Reply #45 on: 10 / December / 2020, 12:40:27 »
 ;) ---> @ gcc1011 seems a bit hysteric with the ints, longs, unsigneds &  & their *pointers.
&& luascript.c breaks without      enter_alt(0);
Code: [Select]
ubasic.c: In function 'statement':
ubasic.c:3371:30: warning: passing argument 2 of 'switch_function' from incompatible pointer type [-Wincompatible-pointer-types]
 3371 |       switch_function(token, enter_alt);
      |                              ^~~~~~~~~
      |                              |
      |                              void (*)(int)
ubasic.c:2681:49: note: expected 'void (*)(void)' but argument is of type 'void (*)(int)'
 2681 | static void switch_function(short token, void (*func)( void))
      |                                          ~~~~~~~^~~~~~~~~~~~
luascript.c: In function 'lua_script_start':
luascript.c:285:13: error: too few arguments to function 'enter_alt'
  285 |             enter_alt();
      |             ^~~~~~~~~
In file included from luascript.c:23:
../include/keyboard.h:101:13: note: declared here
  101 | extern void enter_alt(int script_mode);
      |             ^~~~~~~~~
luascript.c: In function 'luaCB_enter_alt':
luascript.c:1485:3: error: too few arguments to function 'enter_alt'
 1485 |   enter_alt();
      |   ^~~~~~~~~
In file included from luascript.c:23:
../include/keyboard.h:101:13: note: declared here
  101 | extern void enter_alt(int script_mode);
      |             ^~~~~~~~~
gmake[1]: *** [.o/luascript.o] Error 1
gmake: *** [all-recursive] Error 1
// Linecount fits for the Lua-Wheel Version...
Edit: Yesterday I missed a 'hidden' luascript.c update. Probably the reason for that.
NEW .zip
« Last Edit: 11 / December / 2020, 14:30:48 by Caefix »
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 14121
Re: 1.6 development planning thread
« Reply #46 on: 10 / December / 2020, 16:45:59 »
Code: [Select]
ubasic.c: In function 'statement':
ubasic.c:3371:30: warning: passing argument 2 of 'switch_function' from incompatible pointer type [-Wincompatible-pointer-types]
 3371 |       switch_function(token, enter_alt);
      |                              ^~~~~~~~~
I'm confused by this, it doesn't appear in trunk/lib/ubasic.c at all (indeed "switch_function" doesn't appear in my copy of the trunk ??? and it only has 2761 lines. If you are working on some other source tree, you really need to say that when reporting bugs), but I think there's a real problem with the current ubasic enter_alt code:
Code: [Select]
  case TOKENIZER_ENTER_ALT:
      one_int_param_function(token, enter_alt);
      break;     
enter_alt now expects a parameter, but it should be the constant 0 or 1, not a value from script. This is old code, but the value would previously have been ignored.

Quote
Edit: Yesterday I missed a 'hidden' luascript.c update. Probably the reason for that.
NEW .zip
You should use SVN to keep your source up to date.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14121
Re: 1.6 development planning thread
« Reply #47 on: 10 / December / 2020, 16:56:25 »
Any thoughts?
This is ancient stuff, so if the current code works without it, I'm all for getting rid of it.

Note on rnd.c, there are a few cameras without rand in the firmware, but it's implemented under CAM_MISSING_RAND in generic/wrappers.c.
Don't forget what the H stands for.


*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: 1.6 development planning thread
« Reply #48 on: 10 / December / 2020, 17:43:28 »
Any thoughts?
This is ancient stuff, so if the current code works without it, I'm all for getting rid of it.

Looking at the generated code on VxWorks, DryOS, and Thumb2 (D6 & D7), the whole lib/math library can be made redundant.
The math functions in generic/wrappers.c can be renamed and the log2 function can be moved from lib/math/wrappers.c to generic/wrappers.c

Reading the documentation this stuff appears to be from when the compiler was generating non IEEE-754 floating point code and the standard library for soft floating point was non IEEE-754 format.

As we've dropped the ELF compiler support now I think it's pretty safe to remove lib/math
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: 1.6 development planning thread
« Reply #49 on: 11 / December / 2020, 14:27:37 »
Code: [Select]
**** GCC 10.1.1 : BUILDING CHDK-CHDK_DE, #1.6.0-5670 FOR m100-100a
HOSTCFLAGS=-g -O2 -Wall -DBUILD_NUMBER=\"$(BUILD_NUMBER)\" -I$(modules) -std=gnu11 -funsigned-char

ifdef OPT_WARNINGS
    HOSTCFLAGS+=-Wextra -Wunused -Wno-missing-field-initializers -Wno-strict-overflow
    HOSTCFLAGS+= -Wnested-externs -Wpedantic
endif


finsig_vxworks.c:1921:30: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
     { 21, "add_ptp_handler", (char*)find_add_ptp_handler, 0 },
                              ^
finsig_vxworks.c:1923:20: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
     { 21, "mkdir", (char*)find_mkdir, 0 },
                    ^
...


finsig_vxworks.c:1945:21: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
     { 22, "Remove", (char*)find_Remove, 0},
                     ^
finsig_vxworks.c: In function 'match_strsig104':
finsig_vxworks.c:2868:22: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
             instid = (void*)isSTMFD_LR;
                      ^
finsig_vxworks.c:2880:17: warning: ISO C forbids passing argument 2 of 'find_Nth_inst_rev' between function pointer and 'void *' [-Wpedantic]
                 int j2 = find_Nth_inst_rev(fw,instid,j1-1,sig->offset,ninst);
                 ^
In file included from finsig_vxworks.c:10:0:
firmware_load.h:162:5: note: expected 'int (*)(struct firmware *, int)' but argument is of type 'void *'
 int find_Nth_inst_rev(firmware *fw, int (*inst)(firmware*,int), int idx, int len, int N);
     ^
finsig_vxworks.c: In function 'find_strsig':
finsig_vxworks.c:2925:44: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
     case 21:    return fw_process(fw, sig, (int (*)(firmware*, string_sig*, int))(sig->ev_name));
                                            ^
finsig_vxworks.c:2926:25: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
     case 22:    return ((int (*)(firmware*))(sig->ev_name))(fw);
                         ^
finsig_vxworks.c: In function 'find_str_sig_matches':
finsig_vxworks.c:2964:46: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
         qsort(matches, count, sizeof(Match), (void*)match_compare);
                                              ^
finsig_vxworks.c:2964:9: warning: ISO C forbids passing argument 4 of 'qsort' between function pointer and 'void *' [-Wpedantic]
         qsort(matches, count, sizeof(Match), (void*)match_compare);
         ^
In file included from finsig_vxworks.c:1:0:
d:\hostluaportable\chdk-shell\trunk\gcc1011\include\stdlib.h:370:22: note: expected 'int (*)(const void *, const void *)' but argument is of type 'void *'
 _CRTIMP void __cdecl qsort(void*, size_t, size_t,
                      ^
finsig_vxworks.c: In function 'find_matches':
finsig_vxworks.c:3142:46: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
         qsort(matches, count, sizeof(Match), (void*)match_compare);
                                              ^
finsig_vxworks.c:3142:9: warning: ISO C forbids passing argument 4 of 'qsort' between function pointer and 'void *' [-Wpedantic]
         qsort(matches, count, sizeof(Match), (void*)match_compare);
         ^
In file included from finsig_vxworks.c:1:0:
d:\hostluaportable\chdk-shell\trunk\gcc1011\include\stdlib.h:370:22: note: expected 'int (*)(const void *, const void *)' but argument is of type 'void *'
 _CRTIMP void __cdecl qsort(void*, size_t, size_t,
                      ^
finsig_vxworks.c: In function 'print_kmvals':
finsig_vxworks.c:5451:44: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
     qsort(key_info, kcount, sizeof(kinfo), (void*)kinfo_compare);
                                            ^
finsig_vxworks.c:5451:5: warning: ISO C forbids passing argument 4 of 'qsort' between function pointer and 'void *' [-Wpedantic]
     qsort(key_info, kcount, sizeof(kinfo), (void*)kinfo_compare);
     ^
In file included from finsig_vxworks.c:1:0:
d:\hostluaportable\chdk-shell\trunk\gcc1011\include\stdlib.h:370:22: note: expected 'int (*)(const void *, const void *)' but argument is of type 'void *'
 _CRTIMP void __cdecl qsort(void*, size_t, size_t,
                      ^
finsig_vxworks.c: In function 'write_funcs':
finsig_vxworks.c:6187:54: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
     qsort(fns, next_func_entry, sizeof(func_entry*), (void*)compare);
                                                      ^
finsig_vxworks.c:6187:5: warning: ISO C forbids passing argument 4 of 'qsort' between function pointer and 'void *' [-Wpedantic]
     qsort(fns, next_func_entry, sizeof(func_entry*), (void*)compare);
     ^
In file included from finsig_vxworks.c:1:0:
d:\hostluaportable\chdk-shell\trunk\gcc1011\include\stdlib.h:370:22: note: expected 'int (*)(const void *, const void *)' but argument is of type 'void *'
 _CRTIMP void __cdecl qsort(void*, size_t, size_t,
                      ^
stubs_load.c: In function 'add_sig':
stubs_load.c:99:3: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'uint32_t *' [-Wformat=]
   sscanf(val,"%d",&v);
   ^
finsig_dryos.c:2950:30: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
     { 21, "add_ptp_handler", (char*)find_add_ptp_handler, 0 },
                              ^
finsig_dryos.c:2951:22: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
     { 21, "apex2us", (char*)find_apex2us, 0 },

...
All lifetime is a loan from eternity.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal