Browse Source

* throw error properly if a target does not support sections

florian 3 years ago
parent
commit
546455faca
4 changed files with 363 additions and 359 deletions
  1. 3 1
      compiler/msg/errore.msg
  2. 3 2
      compiler/msgidx.inc
  3. 356 355
      compiler/msgtxt.inc
  4. 1 1
      compiler/pdecsub.pas

+ 3 - 1
compiler/msg/errore.msg

@@ -445,7 +445,7 @@ scan_e_unexpected_endif=02108_E_$ENDIF directive found without a matching $IF(N)
 #
 # Parser
 #
-# 03361 is the last used one
+# 03362 is the last used one
 #
 % \section{Parser messages}
 % This section lists all parser messages. The parser takes care of the
@@ -1635,6 +1635,8 @@ parser_e_constructurs_cannot_take_type_parameters=03360_E_Constructors cannot ta
 parser_e_raise_with_noreturn_not_allowed=03361_E_Raise in subroutines declared as noreturn is not allowed
 % \var{noreturn} tells the compiler that the activation scope of the subroutine is never left. This includes exceptions
 % goto or any other mean. While the compiler cannot detect all such cases some are trivial and the compiler gives an error.
+parser_e_section_directive_not_allowed_for_target=03362_E_Directive section not allowed for this target
+% Only some targets (e.g. Embedded and FreeRTOS) support the section directive.
 %
 % \end{description}
 %

+ 3 - 2
compiler/msgidx.inc

@@ -475,6 +475,7 @@ const
   parser_e_location_regpair_only_consecutive=03359;
   parser_e_constructurs_cannot_take_type_parameters=03360;
   parser_e_raise_with_noreturn_not_allowed=03361;
+  parser_e_section_directive_not_allowed_for_target=03362;
   type_e_mismatch=04000;
   type_e_incompatible_types=04001;
   type_e_not_equal_types=04002;
@@ -1148,9 +1149,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 89320;
+  MsgTxtSize = 89374;
 
   MsgIdxMax : array[1..20] of longint=(
-    28,109,362,131,99,63,148,37,223,69,
+    28,109,363,131,99,63,148,37,223,69,
     65,20,30,1,1,1,1,1,1,1
   );

File diff suppressed because it is too large
+ 356 - 355
compiler/msgtxt.inc


+ 1 - 1
compiler/pdecsub.pas

@@ -2421,7 +2421,7 @@ begin
   if pd.typ<>procdef then
     internalerror(2021032801);
   if not (target_info.system in systems_allow_section) then
-    Comment(V_Error,'Directive section not allowed for this target.');
+    Message(parser_e_section_directive_not_allowed_for_target);
 {$ifdef symansistr}
   tprocdef(pd).section:=get_stringconst;
 {$else symansistr}

Some files were not shown because too many files changed in this diff