Comments (6)
Interesting. The original code there was horribly broken (instant segfault). The current version is from me, in the hope of being somewhat okay. However, I don't know of any platform that has 32-bit long
but 64-bit long long
, so I assumed that this check was pointless anyway.
Could you please explain what's going on with your platform? (I'll post some code to determined your sizeof
s in a moment.)
from tgl.
Code to test it (you may need to write llu
instead of lu
):
#include <stdio.h>
int main() {
#define SAY(x) printf("sizeof(" #x ") = %lu\n", sizeof(x))
SAY(int);
SAY(long);
SAY(long long);
SAY(unsigned int);
SAY(unsigned long);
SAY(unsigned long long);
return 0;
}
Here's the output on AMD64:
$ gcc -Wall -Wextra -pedantic -O2 -g -o say_sizeof say_sizeof.c
$ ./say_sizeof
sizeof(int) = 4
sizeof(long) = 8
sizeof(long long) = 8
sizeof(unsigned int) = 4
sizeof(unsigned long) = 8
sizeof(unsigned long long) = 8
$
What platform are you using? What does it say there?
from tgl.
Btw: You may also want to delete the comment Here be dragons
(no longer untested, if you say it works) and the comments in ull2BN
from tgl.
I'm on i686, Ubuntu 14.04 on virtualbox. My output is like this:
sizeof(int) = 4
sizeof(long) = 4
sizeof(long long) = 8
sizeof(unsigned int) = 4
sizeof(unsigned long) = 4
sizeof(unsigned long long) = 8
I removed the other code too, works fine for me. Maybe it's because of virtualbox or something, it is indeed weird.
from tgl.
Not weird, I just thought that i686 worked differently (specifically I always thought that long
was 8 bytes there).
So yeah, I'd like to green-light this PR. However, please note that @vysheng seems very busy; I've been waiting for him to merge #94 and #98 for quite a while.
from tgl.
I thought that too :) Thank you, we'll wait for @vysheng then.
from tgl.
Related Issues (20)
- Command line msg command with secure chats HOT 1
- abrupt abort via spectrum/telegram-purple on arm7l HOT 16
- Strange "was online" time when changing status from online
- 2ASHIII
- Escape " and ' in channel_names
- Could you add layers description in Readme
- Compilation error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’ HOT 10
- force add contact does not work
- view last channel post without join channel
- How to implement method for add new contact or import Contact in golang( or any other language)
- nullptr derefence in the source .\tgl-master\queries.c HOT 1
- FLOOD_WAIT_* not handled well
- eventlib issues HOT 1
- compile error: queries.c: In function ‘_tgl_do_send_photo’ HOT 5
- tgl/queries.c:470: tglq_query_result: Assertion `0' failed on Downloading AUDIO FILES HOT 1
- Problem secret chat message to Iphone
- tgl/queries.c:470: tglq_query_result: Assertion `0' failed HOT 8
- New release tag?
- tl-parser/tl-parser.c:1907:9: note: 'sprintf' output between 2 and 21 bytes into a destination of size 20 HOT 1
- tgl/crypto/rsa_pem_openssl.c:49:37: error: invalid use of incomplete typedef ‘RSA’ {aka ‘struct rsa_st’} HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tgl.