=== modified file 'BZ2StreamScanner.cpp'
--- BZ2StreamScanner.cpp	2011-02-12 13:35:21 +0000
+++ BZ2StreamScanner.cpp	2014-04-13 13:56:00 +0000
@@ -111,7 +111,7 @@
 int BZ2StreamScanner::ensureOutBuffCapacity( size_t newSize )
 {
 	#ifdef PBZIP_DEBUG
-	fprintf( stderr, " start ensureOutBuffCapacity/newSize=%u: [", newSize );
+	fprintf( stderr, " start ensureOutBuffCapacity/newSize=%"PRIuMAX": [", (uintmax_t) newSize );
 	printCurrentState();
 	fprintf( stderr, "\n" );
 	#endif
@@ -152,7 +152,7 @@
 	initOutBuff( newBuff, _outBuff.bufSize, _outBuffCapacityHint );
 
 	#ifdef PBZIP_DEBUG
-	fprintf( stderr, " end ensureOutBuffCapacity/newSize=%u: [", newSize );
+	fprintf( stderr, " end ensureOutBuffCapacity/newSize=%"PRIuMAX": [", (uintmax_t) newSize );
 	printCurrentState();
 	fprintf( stderr, "\n" );
 	#endif
@@ -486,19 +486,21 @@
 }
 
 
+#ifdef PBZIP_DEBUG
 void BZ2StreamScanner::printCurrentState()
 {
-	fprintf( stderr, "current=%d, search pos=%d, end pos=%d; s-c=%d"
+	fprintf( stderr, "current=%ld, search pos=%ld, end pos=%ld; s-c=%ld"
 			"; out buf size=%d; out buf capacity=%d; header found=%d; search status=%d",
-			getInBuffCurrent() - getInBuffBegin(),
-			getInBuffSearchPtr() - getInBuffBegin(),
-			getInBuffEnd() - getInBuffBegin(),
-			getInBuffSearchPtr() - getInBuffCurrent(),
+			(long)(getInBuffCurrent() - getInBuffBegin()),
+			(long)(getInBuffSearchPtr() - getInBuffBegin()),
+			(long)(getInBuffEnd() - getInBuffBegin()),
+			(long)(getInBuffSearchPtr() - getInBuffCurrent()),
 			(int)_outBuff.bufSize,
 			(int)_outBuffCapacity,
 			(int)isBz2HeaderFound(),
 			(int)getSearchStatus() );
 }
+#endif
 
 /**
  * Search next bz2 header. Read more data from file if needed.
@@ -510,8 +512,8 @@
 BZ2StreamScanner::CharType * BZ2StreamScanner::searchNextHeader()
 {
 	#ifdef PBZIP_DEBUG
-	fprintf( stderr, " start searchNextHeader %u/%u... : ",
-		 getInBuffSearchPtr() - getInBuffBegin(), getInBuffSize() );
+	fprintf( stderr, " start searchNextHeader %u/%"PRIuMAX"... : ",
+		 (unsigned) (getInBuffSearchPtr() - getInBuffBegin()), (uintmax_t) getInBuffSize() );
 	printCurrentState();
 	fprintf( stderr, "\n" );
 	#endif
@@ -550,8 +552,8 @@
 	}
 
 	#ifdef PBZIP_DEBUG
-	fprintf( stderr, " end searchNextHeader %u/%u... NOT FOUND: ",
-		 getInBuffSearchPtr() - getInBuffBegin(), getInBuffSize() );
+	fprintf( stderr, " end searchNextHeader %u/%"PRIuMAX"... NOT FOUND: ",
+		 (unsigned) (getInBuffSearchPtr() - getInBuffBegin()), (uintmax_t) getInBuffSize() );
 	printCurrentState();
 	fprintf( stderr, "\n" );
 	#endif
@@ -678,8 +680,8 @@
 	OFF_T startBlock = blockNum;
 	blockNum += _outBuff.bufSize;
 
-	fprintf( stderr, " end getNextStream/blockRange=[%"PRIu64", %"PRIu64"), stream no=%d; seq=%d: [",
-		 startBlock, blockNum, _outBuff.blockNumber, _outBuff.sequenceNumber );
+	fprintf( stderr, " end getNextStream/blockRange=[%"PRIuMAX", %"PRIuMAX"), stream no=%d; seq=%d: [",
+		 (uintmax_t) startBlock, (uintmax_t) blockNum, _outBuff.blockNumber, _outBuff.sequenceNumber );
 	printCurrentState();
 	fprintf( stderr, "\n" );
 	#endif

=== modified file 'BZ2StreamScanner.h'
--- BZ2StreamScanner.h	2011-02-12 13:35:21 +0000
+++ BZ2StreamScanner.h	2014-04-13 13:56:00 +0000
@@ -66,7 +66,9 @@
 	 */
 	virtual void dispose();
 
+	#ifdef PBZIP_DEBUG
 	void printCurrentState();
+	#endif
 	
 private:
 	/* disable copy c-tor */

=== modified file 'ChangeLog'
--- ChangeLog	2014-04-11 19:43:25 +0000
+++ ChangeLog	2014-04-13 13:56:00 +0000
@@ -3,6 +3,7 @@
 - Makefile refinements
 - close redirected stdout on finish for better AFS/NFS support (bug #1300876)
   Thanks to Richard Brittain 
+- Fix printf format vs actual type misalignments (#1236086)
 Changes in 1.1.8 (Jun 10, 2012)
 - Fix of metadata unpreserved on empty files compress (bug #1011021)
 Changes in 1.1.7 (Dec 11, 2011)

=== modified file 'pbzip2.cpp'
--- pbzip2.cpp	2014-04-11 19:36:32 +0000
+++ pbzip2.cpp	2014-04-13 13:56:00 +0000
@@ -513,8 +513,8 @@
 	waitTimer.tv_sec += seconds;
 	#endif
 	#ifdef PBZIP_DEBUG
-	fprintf(stderr, "%s:  waitTimer.tv_sec: %d  waitTimer.tv_nsec: %lld\n", caller, waitTimer.tv_sec,
-		(long long)waitTimer.tv_nsec);
+	fprintf(stderr, "%s:  waitTimer.tv_sec: %"PRIiMAX"  waitTimer.tv_nsec: %"PRIiMAX"\n", caller,
+		(intmax_t)waitTimer.tv_sec, (intmax_t)waitTimer.tv_nsec);
 	#endif
 	int pret = pthread_cond_timedwait(cond, mutex, &waitTimer);
 	// we are not using a compatible pthreads library so abort
@@ -814,8 +814,8 @@
 	
 	safe_mutex_lock(OutMutex);
 	#ifdef PBZIP_DEBUG
-	unsigned long long thid = (unsigned long long) pthread_self();
-	fprintf(stderr, "(%"PRIu64") syncSetLastGoodBlock: %d -> %d; MinErrorBlock: %d -> %d\n",
+	uintmax_t thid = (uintmax_t) pthread_self();
+	fprintf(stderr, "(%"PRIuMAX") syncSetLastGoodBlock: %d -> %d; MinErrorBlock: %d -> %d\n",
 		 thid, LastGoodBlock, newValue, MinErrorBlock, errBlock);
 	#endif
 
@@ -920,9 +920,9 @@
 int waitForPreviousBlock(int blockNumToWait, int errBlockNumber)
 {
 	#ifdef PBZIP_DEBUG
-	unsigned long long thid = (unsigned long long) pthread_self();
+	uintmax_t thid = (uintmax_t) pthread_self();
 	safe_mutex_lock(OutMutex);
-	fprintf( stderr, "(%"PRIu64") waitForPreviousBlock enter: LastGoodBlock=%d"
+	fprintf( stderr, "(%"PRIuMAX") waitForPreviousBlock enter: LastGoodBlock=%d"
 		"; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d; errBlockNumber=%d\n",
 		thid,
 		LastGoodBlock, blockNumToWait, NextBlockToWrite,
@@ -935,7 +935,7 @@
 		if (syncGetTerminateFlag() != 0)
 		{
 			#ifdef PBZIP_DEBUG
-			fprintf(stderr, "(%"PRIu64") waitForPreviousBlock terminated [%d]: blockNumToWait=%d\n",
+			fprintf(stderr, "(%"PRIuMAX") waitForPreviousBlock terminated [%d]: blockNumToWait=%d\n",
 				thid, -1, blockNumToWait );
 			#endif
 			return -1;
@@ -944,7 +944,7 @@
 		safe_mutex_lock(OutMutex);
 
 		#ifdef PBZIP_DEBUG
-		fprintf( stderr, "(%"PRIu64") waitForPreviousBlock before check: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n",
+		fprintf( stderr, "(%"PRIuMAX") waitForPreviousBlock before check: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n",
 			thid, LastGoodBlock, blockNumToWait, NextBlockToWrite, MinErrorBlock );
 		#endif
 
@@ -952,7 +952,7 @@
 		if ( (MinErrorBlock != -1) && (MinErrorBlock < errBlockNumber) )
 		{
 			#ifdef PBZIP_DEBUG
-			fprintf( stderr, "(%"PRIu64") waitForPreviousBlock exit [%d]: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n",
+			fprintf( stderr, "(%"PRIuMAX") waitForPreviousBlock exit [%d]: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n",
 				thid, 2, LastGoodBlock, blockNumToWait, NextBlockToWrite, MinErrorBlock );
 			#endif
 			safe_mutex_unlock(OutMutex);
@@ -962,7 +962,7 @@
 		if (errBlockNumber <= NextBlockToWrite)
 		{
 			#ifdef PBZIP_DEBUG
-			fprintf( stderr, "(%"PRIu64") waitForPreviousBlock exit [%d]: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n",
+			fprintf( stderr, "(%"PRIuMAX") waitForPreviousBlock exit [%d]: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n",
 				thid, 0, LastGoodBlock, blockNumToWait, NextBlockToWrite, MinErrorBlock );
 			#endif
 			safe_mutex_unlock(OutMutex);
@@ -970,7 +970,7 @@
 		}
 
 		#ifdef PBZIP_DEBUG
-		fprintf( stderr, "(%"PRIu64") waitForPreviousBlock to sleep: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n",
+		fprintf( stderr, "(%"PRIuMAX") waitForPreviousBlock to sleep: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n",
 			thid, LastGoodBlock, blockNumToWait, NextBlockToWrite, MinErrorBlock );
 		#endif
 
@@ -1018,8 +1018,8 @@
 	int exitCode)
 {
 	#ifdef PBZIP_DEBUG
-	unsigned long long thid = (unsigned long long) pthread_self();
-	fprintf(stderr, "(%"PRIu64") enter issueDecompressError: msg=%s; ret=%d; block=%d; seq=%d; isLastInSeq=%d; avail_in=%d\n",
+	uintmax_t thid = (uintmax_t) pthread_self();
+	fprintf(stderr, "(%"PRIuMAX") enter issueDecompressError: msg=%s; ret=%d; block=%d; seq=%d; isLastInSeq=%d; avail_in=%d\n",
 		thid,
 		errmsg, bzret, fileData->blockNumber,
 		outSequenceNumber, (int)fileData->isLastInSequence, strm.avail_in);
@@ -1054,8 +1054,8 @@
 	int lastGoodBlock = getLastGoodBlockBeforeErr(fileData->blockNumber, outSequenceNumber);
 
 	#ifdef PBZIP_DEBUG
-	unsigned long long thid = (unsigned long long) pthread_self();
-	fprintf(stderr, "(%"PRIu64") enter decompressErrCheckSingle: msg=%s; ret=%d; block=%d; seq=%d; isLastInSeq=%d; avail_in=%d; lastGoodBlock=%d\n",
+	uintmax_t thid = (uintmax_t) pthread_self();
+	fprintf(stderr, "(%"PRIuMAX") enter decompressErrCheckSingle: msg=%s; ret=%d; block=%d; seq=%d; isLastInSeq=%d; avail_in=%d; lastGoodBlock=%d\n",
 		thid,
 		errmsg, bzret, fileData->blockNumber,
 		outSequenceNumber, (int)fileData->isLastInSequence, strm.avail_in, lastGoodBlock);
@@ -1480,8 +1480,8 @@
 			// give warning to user if block is larger than 250 million bytes
 			if (fileData->bufSize > 250000000)
 			{
-				fprintf(stderr, "pbzip2:  *WARNING: Compressed block size is large [%"PRIu64" bytes].\n",
-						(unsigned long long) fileData->bufSize);
+				fprintf(stderr, "pbzip2:  *WARNING: Compressed block size is large [%"PRIuMAX" bytes].\n",
+						(uintmax_t) fileData->bufSize);
 				fprintf(stderr, "          If program aborts, use regular BZIP2 to decompress.\n");
 			}
 		}
@@ -1504,8 +1504,8 @@
 			}
 		}
 		#ifdef PBZIP_DEBUG
-		fprintf(stderr, "producer:  Buffer: %x  Size: %"PRIu64"   Block: %d\n", fileData->buf,
-			(unsigned long long)fileData->bufSize, NumBlocks);
+		fprintf(stderr, "producer:  Buffer: %p  Size: %"PRIuMAX"   Block: %d\n", fileData->buf,
+			(uintmax_t)fileData->bufSize, NumBlocks);
 		#endif
 
 		fifo->add(fileData);
@@ -1561,7 +1561,7 @@
 	bool isInterrupted = false;
 
 	#ifdef PBZIP_DEBUG
-	unsigned long long thid = (unsigned long long) pthread_self();
+	uintmax_t thid = (uintmax_t) pthread_self();
 	#endif
 
 	if (syncGetTerminateFlag() != 0)
@@ -1569,7 +1569,7 @@
 		isInterrupted = true;
 
 		#ifdef PBZIP_DEBUG
-		fprintf (stderr, "(%"PRIu64") consumer_decompress: interrupt1 - TerminateFlag set.\n", thid);
+		fprintf (stderr, "(%"PRIuMAX") consumer_decompress: interrupt1 - TerminateFlag set.\n", thid);
 		#endif
 	}
 	int minErrBlock = syncGetMinErrorBlock();
@@ -1581,7 +1581,7 @@
 		isInterrupted = true;
 
 		#ifdef PBZIP_DEBUG
-		fprintf (stderr, "(%"PRIu64") consumer_decompress: terminating1 - LastGoodBlock set [%d].\n", thid, syncGetLastGoodBlock());
+		fprintf (stderr, "(%"PRIuMAX") consumer_decompress: terminating1 - LastGoodBlock set [%d].\n", thid, syncGetLastGoodBlock());
 		#endif
 	}
 
@@ -1669,8 +1669,8 @@
 		}
 		
 		#ifdef PBZIP_DEBUG
-		fprintf(stderr, "consumer:  FileData: %x\n", fileData);
-		fprintf(stderr, "consumer:  Buffer: %x  Size: %u   Block: %d\n",
+		fprintf(stderr, "consumer:  FileData: %p\n", fileData);
+		fprintf(stderr, "consumer:  Buffer: %p  Size: %u   Block: %d\n",
 				fileData->buf, (unsigned)fileData->bufSize, fileData->blockNumber);
 		#endif
 
@@ -1838,7 +1838,7 @@
 		disposeMemory(fileData->buf);
 
 		#ifdef PBZIP_DEBUG
-		fprintf(stderr, " OutputBuffer[%d].buf = %x\n", fileData->blockNumber, DecompressedData);
+		fprintf(stderr, " OutputBuffer[%d].buf = %p\n", fileData->blockNumber, DecompressedData);
 		fprintf(stderr, " OutputBuffer[%d].bufSize = %u\n", fileData->blockNumber, outSize);
 		fflush(stderr);
 		#endif
@@ -1925,13 +1925,13 @@
 		safe_mutex_lock(OutMutex);
 		#ifdef PBZIP_DEBUG
 		outBuff * lastnext = (prevBlockInSequence != NULL) ? prevBlockInSequence->next : NULL;
-		fprintf(stderr, "fileWriter:  Block: %d Size: %u Next File Block: %d"
-				", outBufferPos: %u, NumBlocks: %d, producerDone: %d, lastseq=%d"
-				", prev=%llx, next=%llx\n",
-				currBlock, NumBufferedBlocksMax, NextBlockToWrite,
-				outBufferPos, NumBlocks, syncGetProducerDone(), lastseq,
-				(unsigned long long)prevBlockInSequence,
-				(unsigned long long)lastnext);
+		fprintf(stderr, "fileWriter:  Block: %d Size: %"PRIuMAX" Next File Block: %d"
+				", outBufferPos: %"PRIuMAX", NumBlocks: %d, producerDone: %d, lastseq=%d"
+				", prev=%p, next=%p\n",
+				currBlock, (uintmax_t)NumBufferedBlocksMax, NextBlockToWrite,
+				(uintmax_t)outBufferPos, NumBlocks, syncGetProducerDone(), lastseq,
+				prevBlockInSequence,
+				lastnext);
 		#endif
 
 		if ( (LastGoodBlock != -1) && (NextBlockToWrite > LastGoodBlock) )
@@ -1970,7 +1970,7 @@
 		}
 
 		#ifdef PBZIP_DEBUG
-		fprintf(stderr, "fileWriter:  Buffer: %x  Size: %u   Block: %d, Seq: %d, isLast: %d\n",
+		fprintf(stderr, "fileWriter:  Buffer: %p  Size: %u   Block: %d, Seq: %d, isLast: %d\n",
 			OutputBuffer[outBufferPos].buf, OutputBuffer[outBufferPos].bufSize, currBlock,
 			outBlock->sequenceNumber, (int)outBlock->isLastInSequence);
 		#endif
@@ -2052,7 +2052,7 @@
 			}
 			
 			#ifdef PBZIP_DEBUG
-			fprintf(stderr, "Completed: %d%%  NextBlockToWrite: %d/%u        \r", percentComplete, NextBlockToWrite, NumBufferedBlocksMax);
+			fprintf(stderr, "Completed: %d%%  NextBlockToWrite: %d/%"PRIuMAX"        \r", percentComplete, NextBlockToWrite, (uintmax_t)NumBufferedBlocksMax);
 			fflush(stderr);
 			#else
 			if (percentComplete != percentCompleteOld)
@@ -2090,7 +2090,7 @@
 	
 	if (QuietMode != 1)
 	{
-		fprintf(stderr, "    Output Size: %"PRIu64" bytes\n", (unsigned long long)CompressedSize);
+		fprintf(stderr, "    Output Size: %"PRIuMAX" bytes\n", (uintmax_t)CompressedSize);
 	}
 
 	#ifdef PBZIP_DEBUG
@@ -2116,7 +2116,7 @@
 		percentComplete = 100;
 
 		#ifdef PBZIP_DEBUG
-		fprintf(stderr, "Completed: %d%%  NextBlockToWrite: %d/%u        \r", percentComplete, NextBlockToWrite, NumBufferedBlocksMax);
+		fprintf(stderr, "Completed: %d%%  NextBlockToWrite: %d/%"PRIuMAX"        \r", percentComplete, NextBlockToWrite, (uintmax_t)NumBufferedBlocksMax);
 		fflush(stderr);
 		#else
 
@@ -2190,7 +2190,7 @@
 			inSize = bytesLeft;
 
 		#ifdef PBZIP_DEBUG
-		fprintf(stderr, " -> Bytes To Read: %"PRIu64" bytes...\n", inSize);
+		fprintf(stderr, " -> Bytes To Read: %"PRIuMAX" bytes...\n", (uintmax_t)inSize);
 		#endif
 
 		// allocate memory to read in file
@@ -2267,7 +2267,7 @@
 		}
 
 		#ifdef PBZIP_DEBUG
-		fprintf(stderr, "\n   Original Block Size: %u\n", inSize);
+		fprintf(stderr, "\n   Original Block Size: %"PRIuMAX"\n", (uintmax_t)inSize);
 		fprintf(stderr, " Compressed Block Size: %u\n", outSize);
 		#endif
 
@@ -2333,7 +2333,7 @@
 		close(hOutfile);
 	if (QuietMode != 1)
 	{
-		fprintf(stderr, "    Output Size: %"PRIu64" bytes\n", (unsigned long long)CompressedSize);
+		fprintf(stderr, "    Output Size: %"PRIuMAX" bytes\n", (uintmax_t)CompressedSize);
 	}
 
 	syncSetProducerDone(1); // Not really needed for direct version
@@ -2689,7 +2689,7 @@
 		inSize = blockSize;
 
 		#ifdef PBZIP_DEBUG
-		fprintf(stderr, " -> Bytes To Read: %"PRIu64" bytes...\n", inSize);
+		fprintf(stderr, " -> Bytes To Read: %"PRIuMAX" bytes...\n", (uintmax_t)inSize);
 		#endif
 
 		// allocate memory to read in file
@@ -2750,7 +2750,7 @@
 			}
 		}
 		#ifdef PBZIP_DEBUG
-		fprintf(stderr, "producer:  Buffer: %x  Size: %"PRIu64"   Block: %d\n", FileData, inSize, NumBlocks);
+		fprintf(stderr, "producer:  Buffer: %p  Size: %"PRIuMAX"   Block: %d\n", FileData, (uintmax_t)inSize, NumBlocks);
 		#endif
 
 		outBuff * queueElement = new(std::nothrow) outBuff(FileData, inSize, NumBlocks, 0);
@@ -2843,7 +2843,7 @@
 		}
 
 		#ifdef PBZIP_DEBUG
-		fprintf(stderr, "consumer:  Buffer: %x  Size: %u   Block: %d\n",
+		fprintf(stderr, "consumer:  Buffer: %p  Size: %u   Block: %d\n",
 				fileData->buf, (unsigned)fileData->bufSize, fileData->blockNumber);
 		#endif
 
@@ -3068,7 +3068,7 @@
 	// unlikely to get here since more likely exception will be thrown
 	if (OutputBuffer.size() != size)
 	{
-		fprintf(stderr, "pbzip2: *ERROR: Could not initialize (OutputBuffer); size=%u!  Aborting...\n", size);
+		fprintf(stderr, "pbzip2: *ERROR: Could not initialize (OutputBuffer); size=%"PRIuMAX"!  Aborting...\n", (uintmax_t)size);
 		safe_mutex_unlock(OutMutex);
 		exit(1);
 	}
@@ -3762,7 +3762,7 @@
 				continue;
 			}
 			#ifdef PBZIP_DEBUG
-			fprintf(stderr, "argv[%u]: %s   Len: %d\n", i, argv[i], strlen(argv[i]));
+			fprintf(stderr, "argv[%u]: %s   Len: %d\n", (unsigned)i, argv[i], (int)strlen(argv[i]));
 			#endif
 			// get command line options with single "-"
 			// check for multiple switches grouped together
@@ -3997,11 +3997,11 @@
 
 		// do sanity check to make sure integers are the size we expect
 		#ifdef PBZIP_DEBUG
-		fprintf(stderr, "off_t size: %u    uint size: %u\n", sizeof(OFF_T), sizeof(unsigned int));
+		fprintf(stderr, "off_t size: %u    uint size: %u\n", (unsigned)sizeof(OFF_T), (unsigned)sizeof(unsigned int));
 		#endif
 		if (sizeof(OFF_T) <= 4)
 		{
-			fprintf(stderr, "\npbzip2: *WARNING: off_t variable size only %u bits!\n", sizeof(OFF_T)*CHAR_BIT);
+			fprintf(stderr, "\npbzip2: *WARNING: off_t variable size only %u bits!\n", (unsigned)(sizeof(OFF_T)*CHAR_BIT));
 			if (decompress == 1)
 				fprintf(stderr, " You will only able to uncompress files smaller than 2GB in size.\n\n");
 			else
@@ -4370,7 +4370,7 @@
 			if (decompress == 1)
 				fprintf(stderr, " BWT Block Size: %c00k\n", BWTblockSizeChar);
 			if (strcmp(InFilename, "-") != 0) 
-				fprintf(stderr, "     Input Size: %"PRIu64" bytes\n", (unsigned long long)InFileSize);
+				fprintf(stderr, "     Input Size: %"PRIuMAX" bytes\n", (uintmax_t)InFileSize);
 		}
 
 		if (decompress == 1)
@@ -4445,7 +4445,7 @@
 				}
 				if (QuietMode != 1)
 				{
-					fprintf(stderr, "    Output Size: %"PRIu64" bytes\n", (unsigned long long)sizeof(Bz2HeaderZero));
+					fprintf(stderr, "    Output Size: %u bytes\n", (unsigned)sizeof(Bz2HeaderZero));
 					fprintf(stderr, "-------------------------------------------\n");
 				}
 				// remove input file unless requested not to by user or error occurred
@@ -4482,7 +4482,7 @@
 			NumBufferedBlocksMax = NumBufferedBlocksMax - (numCPU * 2);
 		#ifdef PBZIP_DEBUG
 		fprintf(stderr, "pbzip2: maxMemory: %d    blockSize: %d\n", maxMemory, blockSize);
-		fprintf(stderr, "pbzip2: NumBufferedBlocksMax: %u\n", NumBufferedBlocksMax);
+		fprintf(stderr, "pbzip2: NumBufferedBlocksMax: %"PRIuMAX"\n", (uintmax_t)NumBufferedBlocksMax);
 		#endif
 		// check to see if our max buffered blocks is less than numCPU, if yes increase maxMemory
 		// to support numCPU requested unless -m switch given by user
@@ -4492,7 +4492,7 @@
 			{
 				NumBufferedBlocksMax = numCPU;
 				if (QuietMode != 1)
-					fprintf(stderr, "*Warning* Max memory limit increased to %d MB to support %d CPUs\n", ((NumBufferedBlocksMax + (numCPU * 2)) * blockSize)/1000000, numCPU);
+					fprintf(stderr, "*Warning* Max memory limit increased to %"PRIuMAX" MB to support %d CPUs\n", (uintmax_t)((NumBufferedBlocksMax + (numCPU * 2)) * blockSize)/1000000, numCPU);
 			}
 			else
 			{

=== modified file 'pbzip2.h'
--- pbzip2.h	2011-07-11 21:22:50 +0000
+++ pbzip2.h	2014-04-13 13:56:00 +0000
@@ -53,6 +53,9 @@
 
 #include <stdio.h>
 #include <pthread.h>
+
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
 }
 
 // uncomment for debug output

