diff -r d0d7b810646b src/lib-fs/fs-posix.c
--- a/src/lib-fs/fs-posix.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-fs/fs-posix.c	Mon Jun 25 01:33:20 2012 +0300
@@ -291,6 +291,8 @@
 			return -1;
 		}
 		break;
+	case FS_OPEN_MODE_RDONLY:
+	case FS_OPEN_MODE_APPEND:
 	default:
 		i_unreached();
 	}
diff -r d0d7b810646b src/lib-imap-client/imapc-connection.c
--- a/src/lib-imap-client/imapc-connection.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-imap-client/imapc-connection.c	Mon Jun 25 01:33:20 2012 +0300
@@ -313,7 +313,9 @@
 		conn->selecting_box = NULL;
 		conn->selected_box = NULL;
 		break;
-	default:
+	case IMAPC_CONNECTION_STATE_CONNECTING:
+	case IMAPC_CONNECTION_STATE_AUTHENTICATING:
+	case IMAPC_CONNECTION_STATE_DONE:
 		break;
 	}
 }
@@ -1246,6 +1248,8 @@
 		i_error("imapc(%s): Authentication timed out after %u seconds",
 			conn->name, IMAPC_CONNECT_TIMEOUT_MSECS/1000);
 		break;
+	case IMAPC_CONNECTION_STATE_DISCONNECTED:
+	case IMAPC_CONNECTION_STATE_DONE:
 	default:
 		i_unreached();
 	}
diff -r d0d7b810646b src/lib-imap/imap-bodystructure.c
--- a/src/lib-imap/imap-bodystructure.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-imap/imap-bodystructure.c	Mon Jun 25 01:33:20 2012 +0300
@@ -559,6 +559,10 @@
 		str_append(str, cstr);
 		break;
 	}
+	case IMAP_ARG_LIST:
+	case IMAP_ARG_LITERAL_SIZE:
+	case IMAP_ARG_LITERAL_SIZE_NONSYNC:
+	case IMAP_ARG_EOL:
 	default:
 		i_unreached();
 		return FALSE;
diff -r d0d7b810646b src/lib-imap/imap-parser.c
--- a/src/lib-imap/imap-parser.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-imap/imap-parser.c	Mon Jun 25 01:33:20 2012 +0300
@@ -263,6 +263,9 @@
 		arg->literal8 = parser->literal8;
 		arg->str_len = size;
 		break;
+	case ARG_PARSE_NONE:
+	case ARG_PARSE_LITERAL:
+	case ARG_PARSE_LITERAL8:
 	default:
                 i_unreached();
 	}
@@ -592,6 +595,7 @@
 		if (!imap_parser_read_literal_data(parser, data, data_size))
 			return FALSE;
 		break;
+	case ARG_PARSE_NONE:
 	default:
                 i_unreached();
 	}
diff -r d0d7b810646b src/lib-index/mail-cache-transaction.c
--- a/src/lib-index/mail-cache-transaction.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-index/mail-cache-transaction.c	Mon Jun 25 01:33:20 2012 +0300
@@ -1059,7 +1059,8 @@
 		if (seq < ctx->first_new_seq)
 			return FALSE;
 		break;
-	default:
+	case MAIL_CACHE_DECISION_YES:
+	case MAIL_CACHE_DECISION_FORCED:
 		break;
 	}
 
diff -r d0d7b810646b src/lib-index/mail-index-sync-keywords.c
--- a/src/lib-index/mail-index-sync-keywords.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-index/mail-index-sync-keywords.c	Mon Jun 25 01:33:20 2012 +0300
@@ -243,6 +243,7 @@
 			*data &= data_mask;
 		}
 		break;
+	case MODIFY_REPLACE:
 	default:
 		i_unreached();
 	}
diff -r d0d7b810646b src/lib-index/mail-index-sync.c
--- a/src/lib-index/mail-index-sync.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-index/mail-index-sync.c	Mon Jun 25 01:33:20 2012 +0300
@@ -905,6 +905,9 @@
 			}
 		}
 		return FALSE;
+	case MAIL_INDEX_SYNC_TYPE_APPEND:
+	case MAIL_INDEX_SYNC_TYPE_EXPUNGE:
+	case MAIL_INDEX_SYNC_TYPE_FLAGS:
 	default:
 		i_unreached();
 		return FALSE;
diff -r d0d7b810646b src/lib-index/mail-transaction-log-view.c
--- a/src/lib-index/mail-transaction-log-view.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-index/mail-transaction-log-view.c	Mon Jun 25 01:33:20 2012 +0300
@@ -586,6 +586,22 @@
 		array_create_from_buffer(&uids, &uid_buf,
 			sizeof(struct mail_transaction_keyword_reset));
 		break;
+
+	case MAIL_TRANSACTION_HEADER_UPDATE:
+	case MAIL_TRANSACTION_EXT_INTRO:
+	case MAIL_TRANSACTION_EXT_RESET:
+	case MAIL_TRANSACTION_EXT_HDR_UPDATE:
+	case MAIL_TRANSACTION_EXT_REC_UPDATE:
+	case MAIL_TRANSACTION_EXT_ATOMIC_INC:
+	case MAIL_TRANSACTION_MODSEQ_UPDATE:
+	case MAIL_TRANSACTION_EXT_HDR_UPDATE32:
+	case MAIL_TRANSACTION_INDEX_DELETED:
+	case MAIL_TRANSACTION_INDEX_UNDELETED:
+	case MAIL_TRANSACTION_BOUNDARY:
+	case MAIL_TRANSACTION_TYPE_MASK:
+	case MAIL_TRANSACTION_EXPUNGE_PROT:
+	case MAIL_TRANSACTION_EXTERNAL:
+	case MAIL_TRANSACTION_SYNC:
 	default:
 		break;
 	}
diff -r d0d7b810646b src/lib-settings/settings-parser.c
--- a/src/lib-settings/settings-parser.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-settings/settings-parser.c	Mon Jun 25 01:33:20 2012 +0300
@@ -183,7 +183,16 @@
 		case SET_DEFLIST_UNIQUE:
 			copy_unique_defaults(ctx, def, link);
 			break;
-		default:
+
+		case SET_BOOL:
+		case SET_UINT:
+		case SET_UINT_OCT:
+		case SET_TIME:
+		case SET_SIZE:
+		case SET_STR:
+		case SET_DEFLIST:
+		case SET_STRLIST:
+		case SET_ALIAS:
 			break;
 		}
 	}
diff -r d0d7b810646b src/lib-storage/index/dbox-common/dbox-mail.c
--- a/src/lib-storage/index/dbox-common/dbox-mail.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-storage/index/dbox-common/dbox-mail.c	Mon Jun 25 01:33:20 2012 +0300
@@ -205,11 +205,30 @@
 	case MAIL_FETCH_GUID:
 		return dbox_get_cached_metadata(mail, DBOX_METADATA_GUID,
 						MAIL_CACHE_GUID, value_r);
+	case MAIL_FETCH_IMAP_BODY:
+	case MAIL_FETCH_IMAP_BODYSTRUCTURE:
+	case MAIL_FETCH_IMAP_ENVELOPE:
+	case MAIL_FETCH_FROM_ENVELOPE:
+	case MAIL_FETCH_HEADER_MD5:
+	case MAIL_FETCH_MAILBOX_NAME:
+	case MAIL_FETCH_SEARCH_RELEVANCY:
+	case MAIL_FETCH_UIDL_FILE_NAME:
+	case MAIL_FETCH_POP3_ORDER:
 	default:
-		break;
+		return index_mail_get_special(_mail, field, value_r);
+
+	case MAIL_FETCH_FLAGS:
+	case MAIL_FETCH_MESSAGE_PARTS:
+	case MAIL_FETCH_STREAM_HEADER:
+	case MAIL_FETCH_STREAM_BODY:
+	case MAIL_FETCH_DATE:
+	case MAIL_FETCH_RECEIVED_DATE:
+	case MAIL_FETCH_SAVE_DATE:
+	case MAIL_FETCH_PHYSICAL_SIZE:
+	case MAIL_FETCH_VIRTUAL_SIZE:
+	case MAIL_FETCH_NUL_STATE:
+		i_unreached();
 	}
-
-	return index_mail_get_special(_mail, field, value_r);
 }
 
 static int
diff -r d0d7b810646b src/lib-storage/index/imapc/imapc-mail.c
--- a/src/lib-storage/index/imapc/imapc-mail.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-storage/index/imapc/imapc-mail.c	Mon Jun 25 01:33:20 2012 +0300
@@ -392,10 +392,31 @@
 		}
 		*value_r = "";
 		return imapc_mail_get_guid(_mail, value_r);
+	case MAIL_FETCH_IMAP_BODY:
+	case MAIL_FETCH_IMAP_BODYSTRUCTURE:
+	case MAIL_FETCH_IMAP_ENVELOPE:
+	case MAIL_FETCH_FROM_ENVELOPE:
+	case MAIL_FETCH_HEADER_MD5:
+	case MAIL_FETCH_MAILBOX_NAME:
+	case MAIL_FETCH_SEARCH_RELEVANCY:
+	case MAIL_FETCH_UIDL_FILE_NAME:
+	case MAIL_FETCH_UIDL_BACKEND:
+	case MAIL_FETCH_POP3_ORDER:
 	default:
 		break;
+
+	case MAIL_FETCH_FLAGS:
+	case MAIL_FETCH_MESSAGE_PARTS:
+	case MAIL_FETCH_STREAM_HEADER:
+	case MAIL_FETCH_STREAM_BODY:
+	case MAIL_FETCH_DATE:
+	case MAIL_FETCH_RECEIVED_DATE:
+	case MAIL_FETCH_SAVE_DATE:
+	case MAIL_FETCH_PHYSICAL_SIZE:
+	case MAIL_FETCH_VIRTUAL_SIZE:
+	case MAIL_FETCH_NUL_STATE:
+		i_unreached();
 	}
-
 	return index_mail_get_special(_mail, field, value_r);
 }
 
diff -r d0d7b810646b src/lib-storage/index/maildir/maildir-mail.c
--- a/src/lib-storage/index/maildir/maildir-mail.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-storage/index/maildir/maildir-mail.c	Mon Jun 25 01:33:20 2012 +0300
@@ -560,8 +560,27 @@
 			*value_r = p_strdup(mail->data_pool, order);
 		}
 		return 0;
+	case MAIL_FETCH_IMAP_BODY:
+	case MAIL_FETCH_IMAP_BODYSTRUCTURE:
+	case MAIL_FETCH_IMAP_ENVELOPE:
+	case MAIL_FETCH_FROM_ENVELOPE:
+	case MAIL_FETCH_HEADER_MD5:
+	case MAIL_FETCH_MAILBOX_NAME:
+	case MAIL_FETCH_SEARCH_RELEVANCY:
 	default:
 		return index_mail_get_special(_mail, field, value_r);
+
+	case MAIL_FETCH_FLAGS:
+	case MAIL_FETCH_MESSAGE_PARTS:
+	case MAIL_FETCH_STREAM_HEADER:
+	case MAIL_FETCH_STREAM_BODY:
+	case MAIL_FETCH_DATE:
+	case MAIL_FETCH_RECEIVED_DATE:
+	case MAIL_FETCH_SAVE_DATE:
+	case MAIL_FETCH_PHYSICAL_SIZE:
+	case MAIL_FETCH_VIRTUAL_SIZE:
+	case MAIL_FETCH_NUL_STATE:
+		i_unreached();
 	}
 }
 							
diff -r d0d7b810646b src/lib-storage/index/mbox/mbox-mail.c
--- a/src/lib-storage/index/mbox/mbox-mail.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-storage/index/mbox/mbox-mail.c	Mon Jun 25 01:33:20 2012 +0300
@@ -226,11 +226,29 @@
 			return -1;
 		}
 		return 0;
+	case MAIL_FETCH_IMAP_BODY:
+	case MAIL_FETCH_IMAP_BODYSTRUCTURE:
+	case MAIL_FETCH_IMAP_ENVELOPE:
+	case MAIL_FETCH_MAILBOX_NAME:
+	case MAIL_FETCH_SEARCH_RELEVANCY:
+	case MAIL_FETCH_UIDL_FILE_NAME:
+	case MAIL_FETCH_UIDL_BACKEND:
+	case MAIL_FETCH_POP3_ORDER:
 	default:
-		break;
+		return index_mail_get_special(_mail, field, value_r);
+
+	case MAIL_FETCH_FLAGS:
+	case MAIL_FETCH_MESSAGE_PARTS:
+	case MAIL_FETCH_STREAM_HEADER:
+	case MAIL_FETCH_STREAM_BODY:
+	case MAIL_FETCH_DATE:
+	case MAIL_FETCH_RECEIVED_DATE:
+	case MAIL_FETCH_SAVE_DATE:
+	case MAIL_FETCH_PHYSICAL_SIZE:
+	case MAIL_FETCH_VIRTUAL_SIZE:
+	case MAIL_FETCH_NUL_STATE:
+		i_unreached();
 	}
-
-	return index_mail_get_special(_mail, field, value_r);
 }
 
 static bool
diff -r d0d7b810646b src/lib-storage/index/pop3c/pop3c-client.c
--- a/src/lib-storage/index/pop3c/pop3c-client.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-storage/index/pop3c/pop3c-client.c	Mon Jun 25 01:33:20 2012 +0300
@@ -189,6 +189,11 @@
 		i_error("pop3c(%s): Command timed out after %u seconds",
 			client->set.host, POP3C_COMMAND_TIMEOUT_MSECS/1000);
 		break;
+	case POP3C_CLIENT_STATE_DISCONNECTED:
+	case POP3C_CLIENT_STATE_USER:
+	case POP3C_CLIENT_STATE_AUTH:
+	case POP3C_CLIENT_STATE_PASS:
+	case POP3C_CLIENT_STATE_CAPA:
 	default:
 		i_error("pop3c(%s): Authentication timed out after %u seconds",
 			client->set.host, POP3C_CONNECT_TIMEOUT_MSECS/1000);
diff -r d0d7b810646b src/lib-storage/index/pop3c/pop3c-mail.c
--- a/src/lib-storage/index/pop3c/pop3c-mail.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-storage/index/pop3c/pop3c-mail.c	Mon Jun 25 01:33:20 2012 +0300
@@ -150,8 +150,30 @@
 		i_assert(_mail->seq <= mbox->msg_count);
 		*value_r = mbox->msg_uidls[_mail->seq-1];
 		return 0;
+	case MAIL_FETCH_GUID:
+	case MAIL_FETCH_IMAP_BODY:
+	case MAIL_FETCH_IMAP_BODYSTRUCTURE:
+	case MAIL_FETCH_IMAP_ENVELOPE:
+	case MAIL_FETCH_FROM_ENVELOPE:
+	case MAIL_FETCH_HEADER_MD5:
+	case MAIL_FETCH_MAILBOX_NAME:
+	case MAIL_FETCH_SEARCH_RELEVANCY:
+	case MAIL_FETCH_UIDL_FILE_NAME:
+	case MAIL_FETCH_POP3_ORDER:
 	default:
 		return index_mail_get_special(_mail, field, value_r);
+
+	case MAIL_FETCH_FLAGS:
+	case MAIL_FETCH_MESSAGE_PARTS:
+	case MAIL_FETCH_STREAM_HEADER:
+	case MAIL_FETCH_STREAM_BODY:
+	case MAIL_FETCH_DATE:
+	case MAIL_FETCH_RECEIVED_DATE:
+	case MAIL_FETCH_SAVE_DATE:
+	case MAIL_FETCH_PHYSICAL_SIZE:
+	case MAIL_FETCH_VIRTUAL_SIZE:
+	case MAIL_FETCH_NUL_STATE:
+		i_unreached();
 	}
 }
 
diff -r d0d7b810646b src/lib-storage/index/raw/raw-mail.c
--- a/src/lib-storage/index/raw/raw-mail.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-storage/index/raw/raw-mail.c	Mon Jun 25 01:33:20 2012 +0300
@@ -109,8 +109,29 @@
 		*value_r = mbox->have_filename ?
 			mailbox_get_path(_mail->box) : "";
 		return 0;
+	case MAIL_FETCH_GUID:
+	case MAIL_FETCH_IMAP_BODY:
+	case MAIL_FETCH_IMAP_BODYSTRUCTURE:
+	case MAIL_FETCH_IMAP_ENVELOPE:
+	case MAIL_FETCH_HEADER_MD5:
+	case MAIL_FETCH_MAILBOX_NAME:
+	case MAIL_FETCH_SEARCH_RELEVANCY:
+	case MAIL_FETCH_UIDL_BACKEND:
+	case MAIL_FETCH_POP3_ORDER:
 	default:
 		return index_mail_get_special(_mail, field, value_r);
+
+	case MAIL_FETCH_FLAGS:
+	case MAIL_FETCH_MESSAGE_PARTS:
+	case MAIL_FETCH_STREAM_HEADER:
+	case MAIL_FETCH_STREAM_BODY:
+	case MAIL_FETCH_DATE:
+	case MAIL_FETCH_RECEIVED_DATE:
+	case MAIL_FETCH_SAVE_DATE:
+	case MAIL_FETCH_PHYSICAL_SIZE:
+	case MAIL_FETCH_VIRTUAL_SIZE:
+	case MAIL_FETCH_NUL_STATE:
+		i_unreached();
 	}
 }
 
diff -r d0d7b810646b src/lib-storage/list/mailbox-list-fs-flags.c
--- a/src/lib-storage/list/mailbox-list-fs-flags.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib-storage/list/mailbox-list-fs-flags.c	Mon Jun 25 01:33:20 2012 +0300
@@ -141,6 +141,9 @@
 			return 0;
 		}
 		break;
+	case MAILBOX_LIST_FILE_TYPE_UNKNOWN:
+	case MAILBOX_LIST_FILE_TYPE_SYMLINK:
+	case MAILBOX_LIST_FILE_TYPE_OTHER:
 	default:
 		break;
 	}
diff -r d0d7b810646b src/lib/failures.c
--- a/src/lib/failures.c	Mon Jun 25 01:14:03 2012 +0300
+++ b/src/lib/failures.c	Mon Jun 25 01:33:20 2012 +0300
@@ -217,8 +217,16 @@
 	case LOG_TYPE_INFO:
 		fd = log_info_fd;
 		break;
+	case LOG_TYPE_WARNING:
+	case LOG_TYPE_ERROR:
+	case LOG_TYPE_FATAL:
+	case LOG_TYPE_PANIC:
 	default:
 		fd = log_fd;
+		break;
+	case LOG_TYPE_COUNT:
+	case LOG_TYPE_OPTION:
+		i_unreached();
 	}
 
 	if (default_handler(ctx, fd, format, args) < 0) {
@@ -244,8 +252,16 @@
 	case LOG_TYPE_INFO:
 		info_handler(ctx, format, args);
 		break;
+	case LOG_TYPE_WARNING:
+	case LOG_TYPE_ERROR:
+	case LOG_TYPE_FATAL:
+	case LOG_TYPE_PANIC:
 	default:
 		error_handler(ctx, format, args);
+		break;
+	case LOG_TYPE_COUNT:
+	case LOG_TYPE_OPTION:
+		i_unreached();
 	}
 
 	va_end(args);
