Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Had to make change to md5.c to compile on OS X. #35

Closed
pschuegr opened this issue Nov 11, 2013 · 5 comments
Closed

Had to make change to md5.c to compile on OS X. #35

pschuegr opened this issue Nov 11, 2013 · 5 comments
Assignees
Labels

Comments

@pschuegr
Copy link

https://github.com/gammu/gammu/blob/master/libgammu/misc/coding/md5.c#L172

to

  memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
@mmarzantowicz
Copy link
Contributor

Could you post exact error message and more information about compiler you used? Actually your, line has more sense than the original one.

@sgallou
Copy link
Contributor

sgallou commented May 23, 2014

Same error and same fix under Ubuntu 14.04.

@pschuegr
Copy link
Author

Sorry, I don't have the project around anymore to give you the compiler and error information. If I have to rebuild in future, I'll update.

@sgallou
Copy link
Contributor

sgallou commented May 27, 2014

Here is the error, but note that the fix from pschuegr is well, as ctx is pointer, sizeof(ctx) returns the size of the pointer, not the size of the pointed object.

ubuntu@ubuntu-VirtualBox:/domotique/gammu$ make
[ 1%] Built target string
[ 1%] Building C object libgammu/CMakeFiles/libGammu.dir/misc/coding/md5.c.o
/home/ubuntu/domotique/gammu/libgammu/misc/coding/md5.c: In function ‘MD5Final’:
/home/ubuntu/domotique/gammu/libgammu/misc/coding/md5.c:172:23: error: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive /
^
cc1: all warnings being treated as errors
make[2]: *
* [libgammu/CMakeFiles/libGammu.dir/misc/coding/md5.c.o] Erreur 1
make[1]: *** [libgammu/CMakeFiles/libGammu.dir/all] Erreur 2
make: *** [all] Erreur 2
ubuntu@ubuntu-VirtualBox:
/domotique/gammu$

@nijel nijel self-assigned this Dec 29, 2014
@nijel nijel added the bug label Dec 29, 2014
@nijel
Copy link
Member

nijel commented Dec 29, 2014

Fixed in 2c9d94c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants