Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 4d3ca1d868f76bdc3c138e232ca019fd019466eb)
+++ src/CodeGen/CodeGenerator.cc	(revision 888cbe433d3c2fa38fa20f2b18976e3d44b8a51f)
@@ -48,21 +48,36 @@
 	}
 
-	ostream & CodeGenerator::Indenter::operator()( ostream & output ) {
+	ostream & CodeGenerator::Indenter::operator()( ostream & output ) const {
 	  return output << string( cg.cur_indent, ' ' );
 	}
 
-	ostream & operator<<( ostream & output, CodeGenerator::Indenter &indent ) {
+	ostream & operator<<( ostream & output, const CodeGenerator::Indenter &indent ) {
 		return indent( output );
 	}
 
-	CodeGenerator::CodeGenerator( std::ostream &os ) : indent( *this), cur_indent( 0 ), insideFunction( false ), output( os ) { }
+	CodeGenerator::LabelPrinter & CodeGenerator::LabelPrinter::operator()( std::list< Label > & l ) {
+		labels = &l;
+		return *this;
+	}
+
+	ostream & operator<<( ostream & output, CodeGenerator::LabelPrinter &printLabels ) {
+		std::list< Label > & labs = *printLabels.labels;
+		// l.unique(); // assumes a sorted list. Why not use set? Does order matter?
+		for ( Label & l : labs ) {
+			output << l.get_name() + ": ";
+			printLabels.cg.genAttributes( l.get_attributes() );
+		}
+		return output;
+	}
+
+	CodeGenerator::CodeGenerator( std::ostream &os ) : indent( *this), cur_indent( 0 ), insideFunction( false ), output( os ), printLabels( *this ) { }
 
 	CodeGenerator::CodeGenerator( std::ostream &os, std::string init, int indentation, bool infunp )
-			: indent( *this), cur_indent( indentation ), insideFunction( infunp ), output( os ) {
+			: indent( *this), cur_indent( indentation ), insideFunction( infunp ), output( os ), printLabels( *this ) {
 		//output << std::string( init );
 	}
 
 	CodeGenerator::CodeGenerator( std::ostream &os, char *init, int indentation, bool infunp )
-			: indent( *this ), cur_indent( indentation ), insideFunction( infunp ), output( os ) {
+			: indent( *this ), cur_indent( indentation ), insideFunction( infunp ), output( os ), printLabels( *this ) {
 		//output << std::string( init );
 	}
@@ -801,14 +816,4 @@
 	}
 
-	std::string CodeGenerator::printLabels( std::list< Label > &l ) {
-		std::string str( "" );
-		l.unique(); // assumes a sorted list. Why not use set?
-
-		for ( std::list< Label >::iterator i = l.begin(); i != l.end(); i++ )
-			str += (*i).get_name() + ": ";
-
-		return str;
-	}
-
 	void CodeGenerator::handleStorageClass( Declaration *decl ) {
 		switch ( decl->get_storageClass() ) {
Index: src/CodeGen/CodeGenerator.h
===================================================================
--- src/CodeGen/CodeGenerator.h	(revision 4d3ca1d868f76bdc3c138e232ca019fd019466eb)
+++ src/CodeGen/CodeGenerator.h	(revision 888cbe433d3c2fa38fa20f2b18976e3d44b8a51f)
@@ -94,5 +94,12 @@
 			Indenter(CodeGenerator &cg) : cg(cg) {}
 			CodeGenerator & cg;
-			std::ostream& operator()(std::ostream & os);
+			std::ostream& operator()(std::ostream & os) const;
+		};
+
+		struct LabelPrinter {
+			LabelPrinter(CodeGenerator &cg) : cg(cg), labels( 0 ) {}
+			LabelPrinter & operator()( std::list< Label > & l );
+			CodeGenerator & cg;
+			std::list< Label > * labels;
 		};
 
@@ -108,7 +115,7 @@
 		bool insideFunction;
 		std::ostream &output;
+		LabelPrinter printLabels;
 
 		void printDesignators( std::list< Expression * > & );
-		static std::string printLabels ( std::list < Label > & );
 		void handleStorageClass( Declaration *decl );
 		void handleAggregate( AggregateDecl *aggDecl );
Index: src/ControlStruct/LabelGenerator.cc
===================================================================
--- src/ControlStruct/LabelGenerator.cc	(revision 4d3ca1d868f76bdc3c138e232ca019fd019466eb)
+++ src/ControlStruct/LabelGenerator.cc	(revision 888cbe433d3c2fa38fa20f2b18976e3d44b8a51f)
@@ -19,4 +19,5 @@
 #include "LabelGenerator.h"
 #include "SynTree/Label.h"
+#include "SynTree/Attribute.h"
 
 namespace ControlStruct {
@@ -34,5 +35,7 @@
 		os << "__L" << current++ << "__" << suffix;
 		std::string ret = os.str();
-		return Label( ret );
+		Label l( ret );
+		l.get_attributes().push_back( new Attribute("unused") );
+		return l;
 	}
 } // namespace ControlStruct
