comparison OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py @ 4313:91554aecff9a

removed a friend method for better abi
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 09 Nov 2020 16:09:05 +0100
parents 2ae905070221
children 85237ae3a076
comparison
equal deleted inserted replaced
4312:6d49e3b6ff77 4313:91554aecff9a
234 elif i.kind == clang.cindex.CursorKind.VAR_DECL: 234 elif i.kind == clang.cindex.CursorKind.VAR_DECL:
235 if isPublic: 235 if isPublic:
236 ReportProblem('Exported public member variable', fqn, i) 236 ReportProblem('Exported public member variable', fqn, i)
237 237
238 elif i.kind == clang.cindex.CursorKind.FUNCTION_TEMPLATE: 238 elif i.kind == clang.cindex.CursorKind.FUNCTION_TEMPLATE:
239 if isPublic: 239 # An inline function template is OK, as it is not added to
240 ReportProblem('Exported public template method', fqn, i) 240 # a shared library, but compiled by the client of the library
241 241 if isPublic:
242 elif i.kind == clang.cindex.CursorKind.FRIEND_DECL: 242 print('Detected a template function (this is fine, but avoid it as much as possible): %s' % ('::'.join(fqn + [ i.spelling ])))
243 if isPublic: 243 hasImplementation = False
244 ReportProblem('Exported public friend method', fqn, i) 244 for j in i.get_children():
245 245 if j.kind == clang.cindex.CursorKind.COMPOUND_STMT:
246 hasImplementation = True
247
248 if not hasImplementation:
249 ReportProblem('Exported template function without an inline implementation', fqn, i)
250
246 elif (i.kind == clang.cindex.CursorKind.TYPEDEF_DECL or # Allow "typedef" 251 elif (i.kind == clang.cindex.CursorKind.TYPEDEF_DECL or # Allow "typedef"
247 i.kind == clang.cindex.CursorKind.ENUM_DECL): # Allow enums 252 i.kind == clang.cindex.CursorKind.ENUM_DECL): # Allow enums
248 pass 253 pass
249 254
250 else: 255 else: