- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我无法访问我的 original account .如果可能,请版主合并帐户。
这是我的问题。以下 C 程序存在 IA-64 段错误,但在 IA-32 上运行良好。
int main()
{
int* p;
p = (int*)malloc(sizeof(int));
*p = 10;
return 0;
}
为什么会这样?
最佳答案
在 C 中,如果函数未原型(prototype)化,则默认返回类型为 int
。在 ia64 中,指针的大小大于 int,因此它可能会发生段错误。
更新:问题基本上是为什么您应该始终对您的函数进行原型(prototype)设计(或为此包含适当的 header )。
关于c - IA-64 上的段错误,但 IA-32 上没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5387090/
这个问题已经有答案了: With arrays, why is it the case that a[5] == 5[a]? (20 个回答) 已关闭 8 年前。 #include int main
我正在使用 CLion 1.05, int main() { int ia[] = {0, 1, 2, 3, 4}; auto ia2(ia); auto ia3(&ia[0]
我无法访问我的 original account .如果可能,请版主合并帐户。 这是我的问题。以下 C 程序存在 IA-64 段错误,但在 IA-32 上运行良好。 int main() {
我有一个接口(interface) IA 和实现它们的类 B 和 C。B 和 C 都实现了 Parcelable也是。 然后我有棘手的部分: D 类有 ArrayList .我也需要在 arrayli
亚马逊于 2018 年 4 月宣布推出一种名为 One-Zone Infrequent Access 的新存储类,它通过仅使用一个可用区进行存储来降低成本,从而补充了普通 IA 选项。 它的 site
我想知道英特尔IA-32架构的基本数据类型是什么。 我知道其中四个-字节(8位),单词(16位),双字(32位)和quadwords(64位)。还有其他人吗? 最佳答案 是的,您又错过了一个-> do
在《英特尔64和IA-32体系结构手册》第3A卷第9章“处理器管理和初始化”中,我发现了以下内容: Compatibility mode execution is selected on a code
段选择器什么时候出现。英特尔指南中的一行说: "Each segment descriptor has an associated segment selector. A segment select
我能够在硬件模式下使用运行 SGX 并从 IAS 成功检索 SigRL。但当我尝试使用他们的 REST API 执行报价证明时,我遇到了困难。我使用的REST API接口(interface)说明he
谁能解释为什么这段代码有效,即使我只为 st 数组中的 2 个单元格分配内存? int main(void){ st=(int *)malloc(sizeof(int)*2); int j; for(
我正在尝试使用 IA 32 的汇编代码读取命令行参数。我在这里找到了如何执行此操作的解释 http://www.paladingrp.com/ia32.shtml .我可以使用堆栈指针来获取参数的数量
我在IA-32中搜索寻址模式,但没有看到任何网站或文章对寻址模式进行了简单的解释。我需要一篇文章或其他东西,通过内存变化过程中的一些图片简单地解释这件事,并通过图片指定地址模式。 我知道在 IA-32
我正在查看进程的 Linux IA-32 内存模型,我有一个简单的问题。图片中的灰色区域包含什么?它们是否仅用于显示内存的开始和结束?那么,文本是否从 0x0 开始,堆栈从 0xFFFFFFFF 开始
我正在研究英特尔的 IA-32 软件开发人员手册。特别是,我正在阅读以下手册:http://www.intel.com/Assets/PDF/manual/253666.pdf .让我们以 ADD 指
我一直在尝试让 jquery-ias 插件与我的网站一起使用,但是当我在页面底部添加页脚时似乎出现问题。只要不包含页脚,该插件就可以完美运行并按预期加载页面。但是,当我包含页脚时,它会停止滚动并显示“
由于这方面的网络资源很少,为了将来的搜索,我将首先列出 IA-32 汇编语言 (NASM) 的地址模式,然后提出一个简单的问题。 寄存器寻址 mov eax, ebx:将 ebx 中的内容复制到 ea
这几天我一直在为这个问题苦苦挣扎。我正在尝试在容器外部测试 DAO,但在运行测试用例时出现错误: Error creating bean with name 'SqlMapClient' define
我能找到的所有东西都告诉我我应该对齐,因为它可以更有效率,但我找不到我应该在 IA-32 上这样做的硬件问题。这是因为地址总线需要被 4 整除的地址吗?或者因为 RAM 只能提供对齐的数据而不会损失性
我将我的网站设置如下: Visualizati
我在将以下 java 代码转换为 Intel IA-32 程序集时遇到了一些困难: class Person() { char name [8]; int age; void pr
我是一名优秀的程序员,十分优秀!