Index: globtype.pas
===================================================================
--- globtype.pas	(revision 15619)
+++ globtype.pas	(working copy)
@@ -106,6 +106,7 @@
          cs_generate_stackframes,cs_do_assertion,cs_generate_rtti,
          cs_full_boolean_eval,cs_typed_const_writable,cs_allow_enum_calc,
          cs_do_inline,cs_fpu_fwait,
+         cs_no_funcname_result,
          { mmx }
          cs_mmx,cs_mmx_saturation,
          { parser }
Index: pdecsub.pas
===================================================================
--- pdecsub.pas	(revision 15619)
+++ pdecsub.pas	(working copy)
@@ -267,15 +267,19 @@
            { insert the name of the procedure as alias for the function result,
              we can't use realname because that will not work for compilerprocs
              as the name is lowercase and unreachable from the code }
-           if assigned(pd.resultname) then
-             hs:=pd.resultname^
-           else
-             hs:=pd.procsym.name;
-           sl:=tpropaccesslist.create;
-           sl.addsym(sl_load,pd.funcretsym);
-           aliasvs:=tabsolutevarsym.create_ref(hs,pd.returndef,sl);
-           include(aliasvs.varoptions,vo_is_funcret);
-           tlocalsymtable(pd.localst).insert(aliasvs);
+           if (not (cs_no_funcname_result in current_settings.localswitches)) or 
+              assigned(pd.resultname) then //Add it anyway if the result name has been overriden
+            begin
+              if assigned(pd.resultname) then
+                hs:=pd.resultname^
+              else
+                hs:=pd.procsym.name;
+              sl:=tpropaccesslist.create;
+              sl.addsym(sl_load,pd.funcretsym);
+              aliasvs:=tabsolutevarsym.create_ref(hs,pd.returndef,sl);
+              include(aliasvs.varoptions,vo_is_funcret);
+              tlocalsymtable(pd.localst).insert(aliasvs);
+            end;
 
            { insert result also if support is on }
            if (m_result in current_settings.modeswitches) then
Index: scandir.pas
===================================================================
--- scandir.pas	(revision 15619)
+++ scandir.pas	(working copy)
@@ -291,6 +291,12 @@
       end;
 
 
+    procedure dir_no_funcname_result;
+      begin
+        do_localswitch(cs_no_funcname_result);
+      end;
+
+
     procedure dir_objectchecks;
       begin
         do_localswitch(cs_check_object);
@@ -1430,6 +1436,7 @@
         AddDirective('MODESWITCH',directive_all, @dir_modeswitch);
         AddDirective('NODEFINE',directive_all, @dir_nodefine);
         AddDirective('NOTE',directive_all, @dir_note);
+        AddDirective('NOFUNCNAMERESULT',directive_all, @dir_no_funcname_result);
         AddDirective('NOTES',directive_all, @dir_notes);
         AddDirective('OBJECTCHECKS',directive_all, @dir_objectchecks);
         AddDirective('OBJECTPATH',directive_all, @dir_objectpath);
