Replaced printf("warning...") with warning(...).