Skip to content

glib_stubs: undefine g_free - #796

Open
tormath1 wants to merge 1 commit into
vmware:masterfrom
tormath1:tormath1/stubs
Open

glib_stubs: undefine g_free#796
tormath1 wants to merge 1 commit into
vmware:masterfrom
tormath1:tormath1/stubs

Conversation

@tormath1

Copy link
Copy Markdown

otherwise compiler tries to expand the macro to a function. Noticed with glib >= 2.84.4

In file included from /build/amd64-usr/usr/include/glib-2.0/glib/glist.h:34,
                 from /build/amd64-usr/usr/include/glib-2.0/glib/ghash.h:36,
                 from /build/amd64-usr/usr/include/glib-2.0/glib.h:52,
                 from ../lib/rpcChannel/glib_stubs.c:28:
/build/amd64-usr/usr/include/glib-2.0/glib/gmem.h:172:27: error: expected declaration specifiers or '...' before '(' token
  172 |   (__builtin_object_size ((mem), 0) != ((size_t) - 1)) ?                       \
      |                           ^
../lib/rpcChannel/glib_stubs.c:38:6: note: in expansion of macro 'g_free'
   38 | void g_free(void *p) { free(p); }
      |      ^~~~~~
/build/amd64-usr/usr/include/glib-2.0/glib/gmem.h:172:34: error: expected declaration specifiers or '...' before numeric constant
  172 |   (__builtin_object_size ((mem), 0) != ((size_t) - 1)) ?                       \
      |                                  ^
../lib/rpcChannel/glib_stubs.c:38:6: note: in expansion of macro 'g_free'
   38 | void g_free(void *p) { free(p); }
      |      ^~~~~~
/build/amd64-usr/usr/include/glib-2.0/glib/gmem.h:172:37: error: expected ')' before '!=' token
  172 |   (__builtin_object_size ((mem), 0) != ((size_t) - 1)) ?                       \
      |                                     ^~
../lib/rpcChannel/glib_stubs.c:38:6: note: in expansion of macro 'g_free'
   38 | void g_free(void *p) { free(p); }

otherwise compiler tries to expand the macro to a function. Noticed with
glib >= 2.84.4

```
In file included from /build/amd64-usr/usr/include/glib-2.0/glib/glist.h:34,
                 from /build/amd64-usr/usr/include/glib-2.0/glib/ghash.h:36,
                 from /build/amd64-usr/usr/include/glib-2.0/glib.h:52,
                 from ../lib/rpcChannel/glib_stubs.c:28:
/build/amd64-usr/usr/include/glib-2.0/glib/gmem.h:172:27: error: expected declaration specifiers or '...' before '(' token
  172 |   (__builtin_object_size ((mem), 0) != ((size_t) - 1)) ?                       \
      |                           ^
../lib/rpcChannel/glib_stubs.c:38:6: note: in expansion of macro 'g_free'
   38 | void g_free(void *p) { free(p); }
      |      ^~~~~~
/build/amd64-usr/usr/include/glib-2.0/glib/gmem.h:172:34: error: expected declaration specifiers or '...' before numeric constant
  172 |   (__builtin_object_size ((mem), 0) != ((size_t) - 1)) ?                       \
      |                                  ^
../lib/rpcChannel/glib_stubs.c:38:6: note: in expansion of macro 'g_free'
   38 | void g_free(void *p) { free(p); }
      |      ^~~~~~
/build/amd64-usr/usr/include/glib-2.0/glib/gmem.h:172:37: error: expected ')' before '!=' token
  172 |   (__builtin_object_size ((mem), 0) != ((size_t) - 1)) ?                       \
      |                                     ^~
../lib/rpcChannel/glib_stubs.c:38:6: note: in expansion of macro 'g_free'
   38 | void g_free(void *p) { free(p); }
```

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
@legal-compliance-bot

Copy link
Copy Markdown

🛑 Legal Compliance Check Failed

Hi @tormath1, thank you for your contribution!

To merge this Pull Request, you must sign our CLA.

Note: Even if you signed off your commits locally (using git commit -s), you must post the comment below to register your signature with our automated system.
Note: This is a one-time process. Once signed, future contributions to this repository will be verified automatically.

1. Read the Document: Click here to read the CLA
2. Sign via Comment: Copy and paste the exact line below into a new comment on this Pull Request:

I have read the CLA Document and I hereby sign the CLA for this and all future contributions.

⏳ Processing Schedule:
Our 'Compliance Sweeper' runs automatically approximately every 15-20 minutes.
After you post the comment, your status will update automatically during the next scheduled run.
You do not need to take any further action.

@vmware vmware deleted a comment from legal-compliance-bot Bot Aug 3, 2026
@tormath1

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA for this and all future contributions.

@zeha

zeha commented Aug 27, 2026

Copy link
Copy Markdown

@aabusair maybe this could be merged now that the CLA issue is solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants