简体   繁体   English

变量大小是否依赖于语言机器实现意味着什么?

[英]What does it mean that a variable size is language machine implementation dependent?

Hope this is not confusing, but what I mean is why we say for instance that a long int 's size in C is machine implementation dépendent. 希望这不会令人困惑,但我的意思是为什么我们说例如C中的long int的大小是机器实现的依赖。

Does it mean the size is different for ARM processor, x86 processor, or PPC or ...? 是否意味着ARM处理器,x86处理器或PPC或......的大小不同?

It means that the compiler is free to pick any size that it think is appropriate, within the bounds given. 这意味着编译器可以在给定的范围内自由选择它认为合适的任何大小。 (The long int type is defined as having at least a range that corresponds to a 32 bit number.) long int类型定义为至少具有对应于32位数的范围。)

Generally it means that different sizes are used for different platforms, depending on the machine word of the processor. 通常,这意味着根据处理器的机器字,不同的平台使用不同的尺寸。 Different compilers could even use different sizes for the same platform, and theoretically the same compiler could use different sizes for the same platform in different situations. 不同的编译器甚至可以在同一平台上使用不同的大小,理论上相同的编译器可以在不同的情况下对同一平台使用不同的大小。

"does it mean the size is different for ARM processor , x86 processor , or PPC ..." “这是否意味着ARM处理器,x86处理器或PPC的尺寸不同......”

In short: Yes. 简而言之:是的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM