Index: sasmodels/autoc.py
===================================================================
--- sasmodels/autoc.py	(revision c01ed3e2bc363908dd28daf057e445c91561293d)
+++ sasmodels/autoc.py	(revision 15be191e7e24e07018a77657389eb80b7dfcad55)
@@ -93,5 +93,5 @@
                 constants[name] = obj
                 # Claim all constants are declared on line 1
-                snippets.append('#line 1 "%s"'%escaped_filename)
+                snippets.append('#line 1 "%s"\n'%escaped_filename)
                 snippets.append(py2c.define_constant(name, obj))
             elif isinstance(obj, special.Gauss):
@@ -99,5 +99,5 @@
                     var = "GAUSS_"+var
                     constants[var] = value
-                    snippets.append('#line 1 "%s"'%escaped_filename)
+                    snippets.append('#line 1 "%s"\n'%escaped_filename)
                     snippets.append(py2c.define_constant(var, value))
                 #libs.append('lib/gauss%d.c'%obj.n)
@@ -125,4 +125,4 @@
     # update model info
     info.source = unique_libs
-    info.c_code = "\n".join(snippets)
+    info.c_code = "".join(snippets)
     info.Iq = info.Iqac = info.Iqabc = info.Iqxy = info.form_volume = None
Index: sasmodels/py2c.py
===================================================================
--- sasmodels/py2c.py	(revision c01ed3e2bc363908dd28daf057e445c91561293d)
+++ sasmodels/py2c.py	(revision 15be191e7e24e07018a77657389eb80b7dfcad55)
@@ -113,5 +113,5 @@
     generator = SourceGenerator(constants=constants, fname=fname, lineno=lineno)
     generator.visit(tree)
-    c_code = "\n".join(generator.c_proc)
+    c_code = "".join(generator.c_proc)
     return c_code
 
@@ -199,5 +199,5 @@
         self.new_lines = max(self.new_lines, 1 + extra)
         if node is not None and self.add_line_information:
-            self.write_c('# line: %s' % node.lineno)
+            self.write_c('// line: %s' % node.lineno)
             self.new_lines = 1
         if self.current_statement:
@@ -220,4 +220,6 @@
         self.body(node.body)
         if node.orelse:
+            self.unsupported(node, "for...else/while...else not supported")
+
             self.newline()
             self.write_c('else:')
@@ -250,5 +252,5 @@
                     arg_name = arg.id
                 w_str = ("Default Parameters are unknown to C: '%s = %s"
-                         % arg_name, str(default.n))
+                         % (arg_name, str(default.n)))
                 self.warnings.append(w_str)
 
@@ -435,5 +437,5 @@
         self.insert_signature()
         self.insert_c_vars(start_vars)
-        self.c_pointers = []
+        del self.c_pointers[:]
         self.current_function = ""
 
@@ -554,7 +556,9 @@
             self.write_c(':')
             # report the error
-            self.unsupported("unsupported " + self.current_statement)
+            self.unsupported(node, "unsupported " + self.current_statement)
 
     def visit_While(self, node):
+        self.unsupported(node)
+
         self.newline(node)
         self.write_c('while ')
@@ -565,4 +569,5 @@
     def visit_With(self, node):
         self.unsupported(node)
+
         self.newline(node)
         self.write_python('with ')
@@ -581,4 +586,5 @@
         # TODO: print support would be nice, though hard to do
         self.unsupported(node)
+
         # CRUFT: python 2.6 only
         self.newline(node)
@@ -599,4 +605,5 @@
     def visit_Delete(self, node):
         self.unsupported(node)
+
         self.newline(node)
         self.write_python('del ')
@@ -608,4 +615,5 @@
     def visit_TryExcept(self, node):
         self.unsupported(node)
+
         self.newline(node)
         self.write_python('try:')
@@ -616,4 +624,5 @@
     def visit_TryFinally(self, node):
         self.unsupported(node)
+
         self.newline(node)
         self.write_python('try:')
@@ -625,4 +634,5 @@
     def visit_Global(self, node):
         self.unsupported(node)
+
         self.newline(node)
         self.write_python('global ' + ', '.join(node.names))
@@ -654,4 +664,5 @@
     def visit_Raise(self, node):
         self.unsupported(node)
+
         # CRUFT: Python 2.6 / 3.0 compatibility
         self.newline(node)
@@ -676,4 +687,5 @@
     def visit_Attribute(self, node):
         self.unsupported(node, "attribute reference a.b not supported")
+
         self.visit(node.value)
         self.write_python('.' + node.attr)
@@ -779,4 +791,5 @@
     def visit_Dict(self, node):
         self.unsupported(node)
+
         self.write_python('{')
         for idx, (key, value) in enumerate(zip(node.keys, node.values)):
@@ -908,4 +921,5 @@
     def visit_Yield(self, node):
         self.unsupported(node)
+
         self.write_python('yield ')
         self.visit(node.value)
@@ -913,4 +927,5 @@
     def visit_Lambda(self, node):
         self.unsupported(node)
+
         self.write_python('lambda ')
         self.visit(node.args)
@@ -920,4 +935,5 @@
     def visit_Ellipsis(self, node):
         self.unsupported(node)
+
         self.write_python('Ellipsis')
 
@@ -940,4 +956,5 @@
     def visit_DictComp(self, node):
         self.unsupported(node)
+
         self.write_python('{')
         self.visit(node.key)
@@ -969,4 +986,5 @@
     def visit_alias(self, node):
         self.unsupported(node)
+
         self.write_python(node.name)
         if node.asname is not None:
@@ -1031,7 +1049,7 @@
     const = "constant "  # OpenCL needs globals to be constant
     if isinstance(value, int):
-        parts = [const + "int ", name, " = ", "%d"%value, ";"]
+        parts = [const + "int ", name, " = ", "%d"%value, ";\n"]
     elif isinstance(value, float):
-        parts = [const + "double ", name, " = ", "%.15g"%value, ";"]
+        parts = [const + "double ", name, " = ", "%.15g"%value, ";\n"]
     else:
         try:
@@ -1047,5 +1065,5 @@
         elements = ["%.15g"%v for v in value]
         parts = [const + "double ", name, "[]", " = ",
-                 "{\n   ", ", ".join(elements), "\n};"]
+                 "{\n   ", ", ".join(elements), "\n};\n"]
 
     return "".join(parts)
@@ -1100,5 +1118,5 @@
     #snippets.append("")
     for source, fname, lineno in functions:
-        line_directive = '#line %d "%s"'%(lineno, fname.replace('\\', '\\\\'))
+        line_directive = '#line %d "%s"\n'%(lineno, fname.replace('\\', '\\\\'))
         snippets.append(line_directive)
         tree = ast.parse(source)
@@ -1133,8 +1151,8 @@
             .replace(name+'.w', 'GAUSS_W'))
 
-    translation = translate([(code, fname_in, 1)])[0]
+    translation = translate([(code, fname_in, 1)])
 
     with open(fname_out, "w") as file_out:
-        file_out.write(translation)
+        file_out.write("".join(translation))
     print("...Done")
 
