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

1.6 development planning thread

  • 60 Replies
  • 2426 Views
*

Offline Caefix

  • ****
  • 407
  • Sorry, busy deleting test shots...
Re: 1.6 development planning thread
« Reply #50 on: 11 / December / 2020, 14:29:10 »
Advertisements
Code: [Select]


ubasic.c: In function 'goto_statement':
ubasic.c:1513:9: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
 1513 |   if (ln==0xBA5EBA11) {jump_label(string);} else {jump_linenum(ln);}  // :)
      |         ^~
ubasic.c: In function 'test_statement':
ubasic.c:3101:17: warning: unused variable 'physw_status' [-Wunused-variable]
 3101 |     extern long physw_status; // (use compiler warning as a hint. :)
      |                 ^~~~~~~~~~~~
../../core/gui_script.c: In function 'gui_load_script_default':
../../core/gui_script.c:812:41: warning: unused parameter 'arg' [-Wunused-parameter]
  812 | static void gui_load_script_default(int arg)
      |                                     ~~~~^~~
gui_tbox.c: In function 'tbox_move_text':
gui_tbox.c:306:65: warning: operand of '?:' changes signedness from 'int' to 'unsigned int' due to unsignedness of other operand [-Wsign-compare]
  306 |         for (i=(strlen(text) < (unsigned)maxlen-1)?strlen(text):maxlen-1; i>cursor; i--) //
      |                                                                 ^~~~~~~~
user_menu_edit.c: In function 'chk_ext':
user_menu_edit.c:608:20: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  608 |         for (i=0; i<strlen(tst); i++)
      |                    ^
eyefi.c: In function 'hex_only':
eyefi.c:193:19: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  193 |     for (i = 0; i < strlen(str); i++) {
      |                   ^
lib.c: In function 'camera_set_led':
lib.c:61:45: warning: unused parameter 'bright' [-Wunused-parameter]
   61 | void camera_set_led(int led, int state, int bright) {
      |                                         ~~~~^~~~~~
kbd.c:50:5: warning: missing initializer for field 'unpresse' of 'ssymkeys' [-Wmissing-field-initializers]
   50 |     { 0, 0, 0 }
      |     ^
kbd.c:44:14: note: 'unpresse' declared here
   44 |     unsigned unpresse;  // unpress levent
      |              ^~~~~~~~
kbd.c: In function 'my_kbd_read_keys':
kbd.c:176:22: warning: unused variable 'bit' [-Wunused-variable]
  176 |                 long bit = symkeys[n].bit;
      |                      ^~~
boot.c: In function 'spytask':
boot.c:21:19: warning: unused parameter 'ua' [-Wunused-parameter]
   21 | void spytask(long ua, long ub, long uc, long ud, long ue, long uf)
      |              ~~~~~^~
...
      |                                                           ~~~~~^~
boot.c: In function 'setup_mmu_for_chdk':
boot.c:52:21: warning: unused variable 'flagsram' [-Wunused-variable]
   52 |     unsigned flags, flagsram;
      |                     ^~~~~~~~
capt_seq.c:994:21: warning: 'dbgptr' defined but not used [-Wunused-variable]
  994 | static unsigned int dbgptr = 0;
      |                     ^~~~~~
movie_rec.c: In function 'change_video_tables':
movie_rec.c:6:30: warning: unused parameter 'a' [-Wunused-parameter]
    6 | void change_video_tables(int a, int b){
      |                          ~~~~^
movie_rec.c:6:37: warning: unused parameter 'b' [-Wunused-parameter]
    6 | void change_video_tables(int a, int b){
      |                                 ~~~~^
../../../../core/shooting.c: In function 'shooting_set_zoom_speed':
../../../../core/shooting.c:1429:34: warning: unused parameter 'v' [-Wunused-parameter]
 1429 | void shooting_set_zoom_speed(int v) {/*Eos-M*/}
      |                              ~~~~^
:) More warnings less ...
« Last Edit: 12 / December / 2020, 14:38:24 by Caefix »
All lifetime is a loan from eternity.

*

Offline philmoz

  • *****
  • 3233
    • Photos
Re: 1.6 development planning thread
« Reply #51 on: 11 / December / 2020, 16:03:30 »
Code: [Select]


ubasic.c: In function 'goto_statement':
ubasic.c:1513:9: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
 1513 |   if (ln==0xBA5EBA11) {jump_label(string);} else {jump_linenum(ln);}  //
      |         ^~
ubasic.c: In function 'test_statement':
ubasic.c:3101:17: warning: unused variable 'physw_status' [-Wunused-variable]
 3101 |     extern long physw_status; // (use compiler warning as a hint.
      |                 ^~~~~~~~~~~~
../../core/gui_script.c: In function 'gui_load_script_default':
../../core/gui_script.c:812:41: warning: unused parameter 'arg' [-Wunused-parameter]
  812 | static void gui_load_script_default(int arg)
      |                                     ~~~~^~~
gui_tbox.c: In function 'tbox_move_text':
gui_tbox.c:306:65: warning: operand of '?:' changes signedness from 'int' to 'unsigned int' due to unsignedness of other operand [-Wsign-compare]
  306 |         for (i=(strlen(text) < (unsigned)maxlen-1)?strlen(text):maxlen-1; i>cursor; i--) //
      |                                                                 ^~~~~~~~
user_menu_edit.c: In function 'chk_ext':
user_menu_edit.c:608:20: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  608 |         for (i=0; i<strlen(tst); i++)
      |                    ^
eyefi.c: In function 'hex_only':
eyefi.c:193:19: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  193 |     for (i = 0; i < strlen(str); i++) {
      |                   ^
lib.c: In function 'camera_set_led':
lib.c:61:45: warning: unused parameter 'bright' [-Wunused-parameter]
   61 | void camera_set_led(int led, int state, int bright) {
      |                                         ~~~~^~~~~~
kbd.c:50:5: warning: missing initializer for field 'unpresse' of 'ssymkeys' [-Wmissing-field-initializers]
   50 |     { 0, 0, 0 }
      |     ^
kbd.c:44:14: note: 'unpresse' declared here
   44 |     unsigned unpresse;  // unpress levent
      |              ^~~~~~~~
kbd.c: In function 'my_kbd_read_keys':
kbd.c:176:22: warning: unused variable 'bit' [-Wunused-variable]
  176 |                 long bit = symkeys[n].bit;
      |                      ^~~
boot.c: In function 'spytask':
boot.c:21:19: warning: unused parameter 'ua' [-Wunused-parameter]
   21 | void spytask(long ua, long ub, long uc, long ud, long ue, long uf)
      |              ~~~~~^~
...
      |                                                           ~~~~~^~
boot.c: In function 'setup_mmu_for_chdk':
boot.c:52:21: warning: unused variable 'flagsram' [-Wunused-variable]
   52 |     unsigned flags, flagsram;
      |                     ^~~~~~~~
capt_seq.c:994:21: warning: 'dbgptr' defined but not used [-Wunused-variable]
  994 | static unsigned int dbgptr = 0;
      |                     ^~~~~~
movie_rec.c: In function 'change_video_tables':
movie_rec.c:6:30: warning: unused parameter 'a' [-Wunused-parameter]
    6 | void change_video_tables(int a, int b){
      |                          ~~~~^
movie_rec.c:6:37: warning: unused parameter 'b' [-Wunused-parameter]
    6 | void change_video_tables(int a, int b){
      |                                 ~~~~^
../../../../core/shooting.c: In function 'shooting_set_zoom_speed':
../../../../core/shooting.c:1429:34: warning: unused parameter 'v' [-Wunused-parameter]
 1429 | void shooting_set_zoom_speed(int v) {/*Eos-M*/}
      |                              ~~~~^
:) More warnings less ...


Please STOP wasting our time.
AGAIN you show issues in your own code that does NOT exist in the official source, and AGAIN you have not bothered to update to the latest source.

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

  • ****
  • 407
  • Sorry, busy deleting test shots...
Re: 1.6 development planning thread
« Reply #52 on: 12 / December / 2020, 14:37:56 »
Code: [Select]

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

:-[ Without 'my bugs' are 404 lines left, still too much to fit through one window...
« Last Edit: 14 / December / 2020, 11:33:26 by Caefix »
All lifetime is a loan from eternity.

*

Online reyalp

  • ******
  • 13058
Re: 1.6 development planning thread
« Reply #53 on: 12 / December / 2020, 14:59:24 »
:-[ Without 'my bugs' are 404 lines left, still too much to fit through one window...
I would not put effort into making it clean with -Wpedantic or some of the other stuff you have enabled. The point of this exercise is to make it easier to catch real problems. There is no need to enable warnings for things that would never be an actual problem in our implementation.
Don't forget what the H stands for.


*

Offline Caefix

  • ****
  • 407
  • Sorry, busy deleting test shots...
Re: 1.6 development planning thread
« Reply #54 on: 14 / December / 2020, 11:33:04 »
 :) Same first case setting, copied & pasted 100 *   :-*  "  :haha
Code: [Select]
finsig_vxworks.c:1925:19: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
     { 21, "_log", (char*)find_log, 0 },
                   ^*
     { 21, "_log", (char*)"find_log", 0 },
                          ^    &   ^
<120 lines left to ignore, would fit all together...
Code: [Select]
**** GCC 10.1.1 : BUILDING CHDK-CHDK_DE, #1.6.0-5674 FOR ixus265_elph340hs-100c


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: 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: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:\...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: In function 'match_strsig24':
finsig_dryos.c:3888:22: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
             instid = (void*)isSTMFD_LR;
                      ^
finsig_dryos.c:3903: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_dryos.c:9: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_dryos.c:3916: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_dryos.c:9: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_dryos.c: In function 'find_strsig':
finsig_dryos.c:3961: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_dryos.c:3962:25: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
     case 22:    return ((int (*)(firmware*,int))(sig->ev_name))(fw,sig->offset);
                         ^
finsig_dryos.c: In function 'find_str_sig_matches':
finsig_dryos.c:3997:46: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
         qsort(matches, count, sizeof(Match), (void*)match_compare);
                                              ^
finsig_dryos.c:3997: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_dryos.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_dryos.c: In function 'find_matches':
finsig_dryos.c:4175:46: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
         qsort(matches, count, sizeof(Match), (void*)match_compare);
                                              ^
finsig_dryos.c:4175: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_dryos.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_dryos.c: In function 'print_kmvals':
finsig_dryos.c:7260:44: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
     qsort(key_info, kcount, sizeof(kinfo), (void*)kinfo_compare);
                                            ^
finsig_dryos.c:7260: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_dryos.c:1:0:
d:\...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_dryos.c: In function 'find_key_vals':
finsig_dryos.c:7299:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
         if (k >= 0)
         ^
finsig_dryos.c: In function 'write_funcs':
finsig_dryos.c:8191: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_dryos.c:8191: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_dryos.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,
                      ^
Comparing merged setup with today´s wrappers.c shows the other 'cleaned stage'.
« Last Edit: 14 / December / 2020, 13:28:11 by Caefix »
All lifetime is a loan from eternity.

*

Online reyalp

  • ******
  • 13058
Re: 1.6 development planning thread
« Reply #55 on: 14 / December / 2020, 12:59:44 »
:) Same first case setting, copied & pasted 100 *   :-*  "  :haha
Code: [Select]
finsig_vxworks.c:1925:19: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
     { 21, "_log", (char*)find_log, 0 },
                   ^*
     { 21, "_log", (char*)"find_log", 0 },
                          ^    &   ^
<120 lines left to ignore, would fit all together...
I understand you are trying to help and you obviously spend a lot of time here, so I'll try not to flame, but please, this is just wasting time.

If you are going to post code as a fix, you need to test it first. What you did here is very, very wrong and would crash instantly if you had run it by rebuilding a vxworks stubs file. Passing a function pointer as a different kind of pointer is not a problem. It's not a bug. It doesn't need fixing. The warning is under -Wpedantic because it's a very common thing to do, but the standard technically requires it to be a warning.

What you replaced it with doesn't generate a warning, but it's totally nonsense. Instead of passing the function, it passes a string, which other parts of the code will still try to use as a function.
« Last Edit: 14 / December / 2020, 15:03:13 by reyalp »
Don't forget what the H stands for.

*

Offline Caefix

  • ****
  • 407
  • Sorry, busy deleting test shots...
Re: 1.6 development planning thread
« Reply #56 on: 14 / December / 2020, 13:16:20 »
 :blink: Thx, I´ll fix that at once,......done.
Same as yesterday again...

gcc.pdf, page 94:
Quote
Some users try to use ‘-Wpedantic’ to check programs for strict ISO C con-
formance. They soon fi nd that it does not do quite what they want: it fi nds
some non-ISO practices, but not all—only those for which ISO C requires a
diagnostic, and some others for which diagnostics have been added.
:xmas Confirmed...

// -Wpedantic instance within compiler smells a difference between unsigned long and uns. int.
A lot of false positives could be avoided by reducing to unsigned.

Kept it together... & Latest ubasic.c. 123924 bytes & 33383 bytes tokenizer.c....  :lol

// Includes monster-ubasic vs. ubasic-monsters && all else I know about how to avoid to read all my postings in the right order...  :o
(my dayly fail so long...)  :haha
« Last Edit: 18 / February / 2021, 14:31:26 by Caefix »
All lifetime is a loan from eternity.

Re: 1.6 development planning thread
« Reply #57 on: 26 / December / 2020, 14:44:04 »
I'm curious about any future Digic 8 (https://lensxp.com/digic-7-vs-8-processors/) support in CHDK?

Is it:
A) Likely available in next year or so,   :xmas
B) Likely to be available in future years, but not within a year,   :blink: or
C) Not likely ever (perhaps due to some Canon technical changes) or other known issues?    :(

I'm considering the Canon PowerShot SX740, but would love to (eventually) use it with CHDK.

I'm a newbie here, sorry if this is the wrong place to post this.


*

Online reyalp

  • ******
  • 13058
Re: 1.6 development planning thread
« Reply #58 on: 26 / December / 2020, 15:14:35 »
I'm curious about any future Digic 8 (https://lensxp.com/digic-7-vs-8-processors/) support in CHDK?

Is it:
A) Likely available in next year or so,   :xmas
B) Likely to be available in future years, but not within a year,   :blink: or
C) Not likely ever (perhaps due to some Canon technical changes) or other known issues?    :(

I'm considering the Canon PowerShot SX740, but would love to (eventually) use it with CHDK.

I'm a newbie here, sorry if this is the wrong place to post this.
I would say C. There may be a hack developed for digic 8 cameras, but it likely won't be CHDK, due to changes in the Canon codebase. Some reverse engineering progress has been made on the magic lantern forum. See
https://www.magiclantern.fm/forum/index.php?topic=23296.0 and https://chdk.setepontos.com/index.php?topic=13530.0
Don't forget what the H stands for.

Re: 1.6 development planning thread
« Reply #59 on: 26 / December / 2020, 15:27:00 »
Thanks for the quick answer - even if its not what I had hoped for! (I had searched topics for Digic 8 and read a few recent pages of posts before posting.)

 

Related Topics