[英]Disabling DejaGnu Options
有誰知道我如何禁用在文件的源代碼上寫的標志,而不更改此文件的源代碼。 也許我必須更改.exp文件之一?
我想禁用標志-pthread
而不更改此源代碼:
// { dg-do run { target *-*-linux* } }
// { dg-options "-pthread" }
#include <pthread.h>
#include <cxxabi.h>
extern "C" int printf (const char *, ...);
int main()
{
try
{
pthread_exit (0);
}
catch (abi::__forced_unwind &)
{
printf ("caught forced unwind\n");
throw;
}
catch (...)
{
printf ("caught ...\n");
return 1;
}
}
我不認為可以,但是由於*-*-linux目標上的-pthread
只是擴展為-D_REENTRANT
和-lpthread
也許您可以提供替換的libpthread
並在測試標志中添加-L
dir ,以便系統libpthread.so
沒有鏈接。
如果您不提供pthread_exit
的定義,那當然會阻止程序鏈接。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.