Could a gatekeeper please review the following fix for a corner case
in the driver?  Thanks,

-David Coakley / AMD Open Source Compiler Engineering

[Log message]
Fix handling of -x option in combination with stdin input.

The test case is:

  echo '#define TRUE 1' | opencc -c -x assembler-with-cpp -

This would result in an error similar to the following:

  gcc: /tmp/cci#.V9rs9c.s: No such file or directory
  gcc: no input files

The fix is to avoid resetting the source_lang if it has already been
set by the -x option.


Index: osprey/driver/main.c
===================================================================
--- osprey/driver/main.c        (revision 3440)
+++ osprey/driver/main.c        (working copy)
@@ -404,7 +404,8 @@
                        } else {
                                char *obj_name;
                                source_kind = get_source_kind(source_file);
-                               source_lang = invoked_lang;
+                               if (source_lang == L_NONE)
+                                   source_lang = invoked_lang;
                                obj_name = get_object_file(
                                    fix_name_by_lang(source_file));
                                add_object (O_object, obj_name);

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to