Bug 4756 - Adjust debug_print to invoke debug_print_real only once
Summary: Adjust debug_print to invoke debug_print_real only once
Status: NEW
Alias: None
Product: Claws Mail
Classification: Unclassified
Component: Other (show other bugs)
Version: 4.3.0
Hardware: PC All
: P3 normal
Assignee: users
URL:
Depends on: 4753 4751 4752
Blocks:
  Show dependency tree
 
Reported: 2024-01-28 13:47 UTC by olaf
Modified: 2024-02-01 11:06 UTC (History)
0 users

See Also:


Attachments
gtk2-Adjust-debug_printf-to-invoke-debug_print_real-only-.patch (1.05 KB, patch)
2024-01-28 13:47 UTC, olaf
Details | Diff
master-Adjust-debug_printf-to-invoke-debug_print_real-only-.patch (1.05 KB, patch)
2024-01-28 13:48 UTC, olaf
Details | Diff

Description olaf 2024-01-28 13:47:39 UTC
Created attachment 2436 [details]
gtk2-Adjust-debug_printf-to-invoke-debug_print_real-only-.patch

There is no need to call debug_print_real twice. The fmt string can be concatenated by the preprocessor, and further optional arguments
referenced via __VA_ARGS__.

This bug depends on changes provided in bug#4751,bug#4752 and bug#4753.
Comment 1 olaf 2024-01-28 13:48:03 UTC
Created attachment 2437 [details]
master-Adjust-debug_printf-to-invoke-debug_print_real-only-.patch
Comment 2 Paul 2024-01-28 14:28:18 UTC
(In reply to olaf from comment #0)
 > This bug depends on changes provided in bug#4751,bug#4752 and bug#4753.

Please provide just one patch for master, all of the above and this one in just one. Thanks.

Also, if the changes can just be git cherry-picked into the gtk2 branch, then there is no need for 2 patches. Patches for the gtk2 branch are only needed if cherry-picking is not possible.
Comment 3 Jonathan Boeing 2024-01-28 22:04:03 UTC
How broadly have you tested this patch set?

The details escape me, but I remember adding the HAVE_VA_OPT check for compatibility with a supported platform.  Something lacked support for the ', ## __VA_ARGS__' gcc extension.

It was probably an old CentOS/gcc, but maybe a different OS with clang.
Comment 4 olaf 2024-01-29 09:20:26 UTC
Is there actually a list of supported platforms?

The new glib 2.50 requirement certainly raised the bar. glib uses 'asm', which means one needs a compiler which understands at least '-std=gnu90'. Newer glib versions require a C99 capable compiler. I have not checked which version made this mandatory. Likely 2.52, there are comments in commits around 1f33b36cd14b4993dc06d8c0726a3dcf55fd140a.

"Recent" libetpan versions (1.1+) use the 'inline' keyword, which is a C99 feature AFAIK. Maybe '-std=gnu90' includes support for that already. I expected a -std= knob in the openSUSE 12.2 libetpan 1.1 and/or Claws Mail 3.8.1 package, but for some reason both compiled fine without it at that time.

In other words: a C99 capable compiler will likely understand __VA_ARGS_.

Note You need to log in before you can comment on or make changes to this bug.