[英]What is the best way of terminating POSIX multi-threaded application which has critical section code?
[英]What's the best way to check if C code has deprecated POSIX calls?
我一直在研究一些舊的C代碼。 我發現有很多POSIX調用現已過時,並在手冊頁中標記為已棄用 。
檢查代碼中是否仍有棄用的POSIX調用的最佳方法是什么? 我想的是:
我的第一次嘗試是使用grep
的簡單工具(即使它可能會引發誤報)。
>> cd src_dir
>> cat deprecated_calls
printf
strcpy
>> for i in $(cat deprecated_calls) ; do
+> grep -R $i .
+> done
binmath.c:printf (" 0 sum:[%s]\n",sum);
binmath.c:printf (" 100 sum:[%s]\n",sum);
binmath.c:printf (" 200 sum:[%s]\n",sum);
binmath.c:printf (" 300 sum:[%s]\n",sum);
qq.c:printf("%d %d %d\n",i,j,k);
xx.c: fprintf (stderr, "Cannot open 'words.txt', error = %d\n", errno);
binmath.c:strcpy (buff, "0");
oldstuff/qq.c:printf("%d %d %d\n",i,j,k);
我懷疑你需要一個完整的解析器類型的工具。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.