WrapEarnPass left a comment (geany/geany-plugins#1582)

Moved this from the initial comment so I could add "about this plugin" to the 
initial comment.
```
$ git log | head
commit ae7e926e126a46a09eb3824886ce89a882a270ef
$ make clean && make install
rm -f  autorun.la
rm -rf .libs _libs
rm -f *.o
rm -f *.lo
rm -f ./so_locations
  CC       autorun_la-autorun.lo
  CC       autorun_la-plugin_main.lo
  CC       autorun_la-spawn.lo
  CC       autorun_la-utils.lo
  CCLD     autorun.la
```

```
$ cppcheck *.c --enable=all --check-level=exhaustive 2>&1 | grep -vP 
'(<glib/gstdio.h>|<geanyplugin.h>|<gtk/gtk.h>|<spawn.h>)'
Checking autorun.c ...
1/4 files checked 23% done
Checking plugin_main.c ...
plugin_main.c:117:42: style: Parameter 'plugin' can be declared as pointer to 
const. However it seems that 'autorun_cleanup' is a callback function, if 
'plugin' is declared with const you might also need to cast function 
pointer(s). [constParameterCallback]
static void autorun_cleanup(GeanyPlugin* plugin, gpointer pdata) {
                                         ^
plugin_main.c:136:27: note: You might need to cast the function pointer here
 plugin->funcs->cleanup = autorun_cleanup;
                          ^
plugin_main.c:117:42: note: Parameter 'plugin' can be declared as pointer to 
const
static void autorun_cleanup(GeanyPlugin* plugin, gpointer pdata) {
                                         ^
2/4 files checked 43% done
Checking spawn.c ...
spawn.c:136:46: style: Condition 'success' is always true 
[knownConditionTrueFalse]
    if (g_strcmp0(interceptor, "BS") == 0 && success && !tmpfile) {
                                             ^
spawn.c:49:17: style: Variable 'cmd' can be declared as pointer to const 
[constVariablePointer]
   AUTORUN_CMD* cmd = ((AUTORUN_CMD*)elem->data);
                ^
spawn.c:179:15: style: Variable 'lineptr' can be declared as pointer to const 
[constVariablePointer]
       gchar* lineptr = g_strstr_len(stdout_data->str, 255, ":");
              ^
spawn.c:203:15: style: Variable 'lineptr' can be declared as pointer to const 
[constVariablePointer]
       gchar* lineptr = g_strstr_len(stdout_data->str, 255, ":");
              ^
spawn.c:221:15: style: Variable 'lineptr' can be declared as pointer to const 
[constVariablePointer]
       gchar* lineptr = g_strstr_len(stdout_data->str, 255, ":");
              ^
spawn.c:238:15: style: Variable 'lineptr' can be declared as pointer to const 
[constVariablePointer]
       gchar* lineptr = g_strstr_len(stdout_data->str, 255, ":");
              ^
3/4 files checked 86% done
Checking utils.c ...
4/4 files checked 100% done
plugin_main.c:124:0: style: The function 'geany_load_module' is never used. 
[unusedFunction]
void geany_load_module(GeanyPlugin* plugin) {
autorun.c:26:0: style: The function 'autorun_cmd_new' should have static 
linkage since it is not used outside of its translation unit. [staticFunction]
AUTORUN_CMD* autorun_cmd_new() {
^
autorun.c:38:0: style: The function 'autorun_cmd_free' should have static 
linkage since it is not used outside of its translation unit. [staticFunction]
void autorun_cmd_free(AUTORUN_CMD* cmd) {
^
nofile:0:0: information: Active checkers: 109/856 (use 
--checkers-report=<filename> to see details) [checkersReport]
```

I know this project doesnt use clang-tidy, but I happen to use it, so I set it 
up too.
```
$ clang-tidy-19 -p autorun/build *.c 
[1/4] Processing file autorun/src/autorun.c.
[2/4] Processing file autorun/src/plugin_main.c.
1 error generated.
Error while processing autorun/src/plugin_main.c.
[3/4] Processing file autorun/src/spawn.c.
1 error generated.
Error while processing autorun/src/spawn.c.
[4/4] Processing file autorun/src/utils.c.
1 error generated.
Error while processing autorun/src/utils.c.
autorun/src/plugin_main.c:132:19: error: use of undeclared identifier 
'LOCALEDIR' [clang-diagnostic-error]
  132 |         main_locale_init(LOCALEDIR, GETTEXT_PACKAGE);
      |                          ^
Found compiler error(s).
```
That looks like clang-tidy doesn't get the po/ loader magic, but nothing else 
reported.

built against geany/geany@98bcbee3b99d71dfcdd9d3556ace9530ceda818d
geany --verbose has no messages

Closes geany/geany-plugins#1577
May close geany/geany-plugins#733


-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1582#issuecomment-4788819047
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany-plugins/pull/1582/[email protected]>

Reply via email to