在gcc / g ++的__declspec(裸体)的等效 [英] Equivalent of __declspec( naked ) in gcc/g++

查看:514
本文介绍了在gcc / g ++的__declspec(裸体)的等效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是在相当于__ declspec(裸) GCC / G ++ __ declspec(裸)实际上是用来声明函数无任何尾声和序幕。

What is the equivalent of __declspec( naked ) in gcc/g++? __declspec( naked ) is actually used to declare a function without any epilogue and prologue.

推荐答案

我相信不存在这样的等价物在Linux下GCC最近。编译器发出序言和尾声适当的时候,你应该离开这个决定给它。这可能是在做序言或尾声相当小,甚至有时不存在的相当不错。

I believe there is no such equivalent with a recent GCC under Linux. The compiler emit prologues and epilogues when appropriate, and you should leave that decision to it. It may be quite good at making prologues or epilogues quite small, or even sometimes non-existent.

您可以code在装配的功能。或者,你可以把汇编代码的函数中。

You could code your function in assembly. Or you can put asm statements inside your function.

和你没有告诉你为什么要这么做。什么是你的目标,为什么precisely你要问?

And you did not tell why you want to do that. What is your goal, and why precisely are you asking?

这篇关于在gcc / g ++的__declspec(裸体)的等效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆