]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Tweak comments
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 12 Jan 2019 13:22:09 +0000 (14:22 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 12 Jan 2019 13:22:09 +0000 (14:22 +0100)
src/ccache.c
test/suites/direct_gcc.bash

index af2461203284e036b595c0aa1b45cf3e5b4cbd3f..b4cdb865f81fc62f247a01d838af9b8ddcd30e39 100644 (file)
@@ -3079,10 +3079,11 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                }
        } // for
 
-       // See http://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html
+       // See <http://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html>.
        // Contrary to what the documentation seems to imply the compiler still
-       // creates object files with these defined (confirmed with GCC 8.2.1)
-       // These environment variables do nothing on CLANG
+       // creates object files with these defined (confirmed with GCC 8.2.1), i.e.
+       // they work as -MMD/-MD, not -MM/-M. These environment variables do nothing
+       // on Clang.
        char *dependencies_env = getenv("DEPENDENCIES_OUTPUT");
        bool using_sunpro_dependencies = false;
        if (!dependencies_env) {
@@ -3098,12 +3099,14 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                free(output_dep);
                output_dep = make_relative_path(x_strdup(abspath_file));
 
-               // Specifying target object is optional
+               // Specifying target object is optional.
                char *abspath_obj = strtok_r(NULL, " ", &saveptr);
                if (abspath_obj) {
+                       // It's the "file target" form.
+
                        dependency_target_specified = true;
                        char *relpath_obj = make_relative_path(x_strdup(abspath_obj));
-                       // ensure compiler gets relative path
+                       // Ensure compiler gets relative path.
                        char *relpath_both = format("%s %s", output_dep, relpath_obj);
                        if (using_sunpro_dependencies) {
                                x_setenv("SUNPRO_DEPENDENCIES", relpath_both);
@@ -3113,8 +3116,10 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                        free(relpath_obj);
                        free(relpath_both);
                } else {
+                       // It's the "file" form.
+
                        dependency_implicit_target_specified = true;
-                       // ensure compiler gets relative path
+                       // Ensure compiler gets relative path.
                        if (using_sunpro_dependencies) {
                                x_setenv("SUNPRO_DEPENDENCIES", output_dep);
                        } else {
index 997b3f0bc3b3c26cb720e965c7f665a3c9a0bc20..4eb9bf6b5fcb58b39c5b65ca5459c69a7a19f5b4 100644 (file)
@@ -139,4 +139,4 @@ SUITE_direct_gcc() {
     expect_stat 'cache miss' 1
     expect_equal_files different_name.d expected_sunpro_dependencies_target.d
     expect_equal_object_files reference_test.o test.o
-}
\ No newline at end of file
+}