我越來越inling警告如:Supressing內聯警告
warning: inlining failed in call to ‘symbol_Arity’: call is unlikely and code size would grow
爲了擺脫這個我改變了生成文件去除-Winline擺脫這一點。我沒有得到任何內聯警告。但是,我不知道它在表演方面有多聰明。任何人都可以給我建議嗎?
增加了一些詳細信息:
這裏是個警告:
search.c: In function ‘prfs_InsertInSortTheories’:
list.h:254: warning: inlining failed in call to ‘list_Delete’: call is unlikely and code size would grow
search.c:187: warning: called from here
list.h:254: warning: inlining failed in call to ‘list_Delete’: call is unlikely and code size would grow
search.c:189: warning: called from here
和相應的代碼是:
從list.h
254 static __inline__ void list_Delete(LIST L)
255 {
256 LIST Current;
257
258 Current = L;
259 while (!list_Empty(Current)) {
260 L = list_Cdr(L);
261 list_Free(Current);
262 Current = L;
263 }
和搜索。 c
176 LIST approx;
177 l = clause_Length(Clause);
178 for (i = clause_FirstSuccedentLitIndex(Clause); i < l; i++) {
179 lit = clause_GetLiteral(Clause,i);
180 if (clause_LiteralIsMaximal(lit) &&
181 symbol_IsBaseSort(term_TopSymbol(clause_LiteralSignedAtom(lit)))) {
182 if (prfs_DynamicSortTheory(Search) != (SORTTHEORY)NULL
183 && clause_NumOfSuccLits(Clause) == 1 &&
184 clause_NumOfAnteLits(Clause) == 0)
185 {
186 copy = clause_Copy(Clause);
187 list_Delete(clause_ParentClauses(copy));
188 clause_SetParentClauses(copy,list_Nil());
189 list_Delete(clause_ParentLiterals(copy));
190 clause_SetParentLiterals(copy,list_Nil());
191 clause_SetNumber(copy,clause_Number(Clause));
192 sort_TheoryInsertClause(prfs_DynamicSortTheory(Search),Clause,
193 copy,clause_GetLiteral(copy,i));
194 }
爲什麼你使用'內聯__inline__'而不是標準的C++關鍵字'inline'? – 2010-05-09 18:35:55
我很抱歉,我誤標了它。這個代碼實際上是用C語言編寫的,但它已經從C90轉換爲C99。我認爲即使對於C99,關鍵字也不相同。我改變了關鍵詞。即使我和以前一樣。 – thetna 2010-05-09 19:26:02