def get_raw_warning(raw_input_file, initial_index):
    """This function returns the total text of a gbuild warning message.

    Inputs:
        - raw_input_file: Absolute path to the raw gbuild compiler log containing warnings [string]
        - initial_index: The numeric index of where the warnings was found in the log file [int]

    Outputs:
        - warning_text: Full text of the warning starting at initial_index [string]
    """

    # Read in the input file
    with open(raw_input_file, 'r') as input_fh:
        input_data = input_fh.readlines()

    # Initialize variables
    start_point = 0
    end_point = len(input_data)

    # Get the initial line
    current_index = initial_index
    line = input_data[current_index]

    # Get the start point
    while (not line.startswith('\n')) and ('output from compiling' not in line.lower()):
        # Update the start point
        start_point = current_index

        # Update the current line
        current_index = current_index - 1
        line = input_data[current_index]

    # Get the initial line
    current_index = initial_index
    line = input_data[current_index]

    # Get the end point
    while not line == '\n':
        # Update the end point
        end_point = current_index

        # Update the current line
        current_index = current_index + 1
        line = input_data[current_index]

    # Store the warning text
    warning_text = []
    for i in range(start_point, end_point):
        warning_text.append(input_data[i])

    return warning_text