Skip to content

Fix Blob_t vs ContactBlob type differences#68

Open
dfandrich wants to merge 1 commit into
juddmon:masterfrom
dfandrich:blob
Open

Fix Blob_t vs ContactBlob type differences#68
dfandrich wants to merge 1 commit into
juddmon:masterfrom
dfandrich:blob

Conversation

@dfandrich
Copy link
Copy Markdown

These structs are defined differently with a potentially different
memory layouts so they cannot be treated as the same.

This difference causes a compile failure with gcc 15.1

These structs are defined differently with a potentially different
memory layouts so they cannot be treated as the same.
@dfandrich
Copy link
Copy Markdown
Author

I should mention that I've only compiled this patch, but I haven't tested it (though it's quite simple to inspect).

@eklausme
Copy link
Copy Markdown
Collaborator

Your proposed change is valid and good.

For the Arch Linux package jpilot I simply used a sed and a cast to fix the glitch during build time:

sed 's/return Contact_add_blob(c, blob);/return Contact_add_blob(c, (void*)blob);/' jp-contact.c > /tmp/jp-contact.c

The problem you addressed here is a permanent nuisance between the different versions of pilot-link.

  1. According the latest master branch for pilot-link, we have pi-contact.h:
extern int Contact_add_blob
    PI_ARGS((struct Contact *, Blob_t *));
  1. According the source code contact.c in pilot-link, it is
int Contact_add_blob(struct Contact *c, Blob_t *blob) { ... }
  1. On Arch Linux, however, pilot-link's pi-contact.h says
extern int Contact_add_blob
    PI_ARGS((struct Contact *, struct ContactBlob *));

I assume your distros uses the same mess.

So, for me it looks that we are fixing something in J-Pilot that should be fixed in pilot-link's repositories for the various distros.

@dfandrich
Copy link
Copy Markdown
Author

My distro, as well as https://github.com/jichu4n/pilot-link/, both have struct ContactBlob *blob as the parameter in both contact.c and pi-contact.h. Did someone patch the version in your distro? I don't see how such a mismatch between prototype and function would work given that the types are of different sizes (at least on some platforms). gcc's latest release is even more picky than normal about that kind of thing. Unless there's a new upstream that I haven't seen that has changed those types, I think jpilot should be fixed to match pilot-link.

@eklausme
Copy link
Copy Markdown
Collaborator

"Your" repository from jichu4n is 9 years old.

Please have a look at the history of pi-contact.h here: commit history.

I consider desrod's repository to be the "official" pilot-link repository. However, not everyone agrees with that.

@juddmon
Copy link
Copy Markdown
Owner

juddmon commented Apr 6, 2026

The warning for gcc 15 has been fixed in master. Please verify and test if you are able.

@desrod
Copy link
Copy Markdown

desrod commented May 24, 2026

I consider desrod's repository to be the "official" pilot-link repository. However, not everyone agrees with that.

@eklausme Thank you for your support!

Project forks are fine, and I encourage them, as they help build momentum behind new ideas, but when someone decides their fork is suddenly the main project location, that's where I push back. desrod/pilot-link is, and has always been the main project development source tree (well, since I moved it from CVS to Git).

It's been too many years I've had to step away from the project due to personal and professional commitments, but I'm back, actively developing and updating the code. I've made 54 commits in the last week to bring it to current, squash dozens of warnings, closed long-standing memory leak and code-level issues that passed many eyes without being caught.

I'm waiting to take receipt of a Centro device from a community member to test some last-mile issues with text messages, and then I'll close the remaining PRs/issues, and push a 0.15.0 release.

PR #76 I just pushed also ensures J-Pilot builds clean on Linux and macOS, and against the 0.15.0 API/ABI, which brings these both back into congruence.

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.

4 participants