This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/14911] static const symbols lost when referred in asm


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-22 17:20 -------
Just to let you know that I hear that mplayer has not accepted a patch to fix this yet, here is a way to 
use the attribute for both 3.4.0 and above and 2.95.3:
#define ATTRIBUTE_USED
#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >=4)
#undef ATTRIBUTE_USED
#define ATTRIBUTE_USED __attribute__((used))
#endif
static const int hello ATTRIBUTE_USED  = 56;
int main()
{
        asm(
        "mov hello, %eax\n"
        );
        return 0;
}

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14911


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]