Skip to content

Commit

Permalink
fbc: error message for undefined built-in symbol
Browse files Browse the repository at this point in the history
- if '-z nobuiltins' or some built-in procedure was
  undefined (#undef by user), then show a special
  message to indicate that a built-in symbol is
  undefined
  • Loading branch information
jayrm committed Feb 24, 2024
1 parent 0cd8514 commit 0fad2ce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/compiler/error.bas
Expand Up @@ -430,6 +430,7 @@ declare function hMakeParamDesc _
/'FB_ERRMSG_GFXLIBNOTSUPPORTEDFORTARGET '/ @"Graphics routines were used, but the gfxlib has not been ported to this target", _
/'FB_ERRMSG_SSEREQUIRESX86 '/ @"-fpu sse option can only be used on x86 and x86_64 architectures", _
/'FB_ERRMSG_NEONREQUIRESARM '/ @"-fpu neon option can only be used on arm architectures", _
/'FB_ERRMSG_UNDEFINEDBUILTINSYMBOL '/ @"Undefined built-in symbol", _
/'FB_ERRMSGS '/ @"FB_ERRMSGS" _
}

Expand Down
1 change: 1 addition & 0 deletions src/compiler/error.bi
Expand Up @@ -335,6 +335,7 @@ enum FB_ERRMSG
FB_ERRMSG_GFXLIBNOTSUPPORTEDFORTARGET
FB_ERRMSG_SSEREQUIRESX86
FB_ERRMSG_NEONREQUIRESARM
FB_ERRMSG_UNDEFINEDBUILTINSYMBOL

FB_ERRMSGS
end enum
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/rtl.bas
Expand Up @@ -309,7 +309,7 @@ function rtlProcLookup _
pname = strptr( tmp_name )
chain_ = symbLookupAt( @symbGetGlobalNamespc( ), pname, FALSE, FALSE )
if( chain_ = NULL ) then
errReportEx( FB_ERRMSG_UNDEFINEDSYMBOL, *pname )
errReportEx( FB_ERRMSG_UNDEFINEDBUILTINSYMBOL, *pname )
rtlLookupTB( pidx ) = NULL
else
rtlLookupTB( pidx ) = chain_->sym
Expand Down

0 comments on commit 0fad2ce

Please sign in to comment.